diff options
Diffstat (limited to 'web/react/pages/channel.jsx')
-rw-r--r-- | web/react/pages/channel.jsx | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/web/react/pages/channel.jsx b/web/react/pages/channel.jsx index b73dfdafe..2122c729e 100644 --- a/web/react/pages/channel.jsx +++ b/web/react/pages/channel.jsx @@ -6,7 +6,6 @@ import ChannelLoader from '../components/channel_loader.jsx'; import ErrorBar from '../components/error_bar.jsx'; import ErrorStore from '../stores/error_store.jsx'; -import MentionList from '../components/mention_list.jsx'; import GetTeamInviteLinkModal from '../components/get_team_invite_link_modal.jsx'; import RenameChannelModal from '../components/rename_channel_modal.jsx'; import EditPostModal from '../components/edit_post_modal.jsx'; @@ -19,9 +18,20 @@ import RegisterAppModal from '../components/register_app_modal.jsx'; import ImportThemeModal from '../components/user_settings/import_theme_modal.jsx'; import InviteMemberModal from '../components/invite_member_modal.jsx'; +import PreferenceStore from '../stores/preference_store.jsx'; + +import * as Utils from '../utils/utils.jsx'; import * as AsyncClient from '../utils/async_client.jsx'; import * as EventHelpers from '../dispatcher/event_helpers.jsx'; +import Constants from '../utils/constants.jsx'; + +function onPreferenceChange() { + const selectedFont = PreferenceStore.getPreference(Constants.Preferences.CATEGORY_DISPLAY_SETTINGS, 'selected_font', {value: Constants.DEFAULT_FONT}).value; + Utils.applyFont(selectedFont); + PreferenceStore.removeChangeListener(onPreferenceChange); +} + function setupChannelPage(props, team, channel) { if (props.PostId === '') { EventHelpers.emitChannelClickEvent(channel); @@ -29,6 +39,7 @@ function setupChannelPage(props, team, channel) { EventHelpers.emitPostFocusEvent(props.PostId); } + PreferenceStore.addChangeListener(onPreferenceChange); AsyncClient.getAllPreferences(); // ChannelLoader must be rendered first @@ -47,21 +58,6 @@ function setupChannelPage(props, team, channel) { document.getElementById('channel_view') ); - ReactDOM.render( - <MentionList id='post_textbox' />, - document.getElementById('post_mention_tab') - ); - - ReactDOM.render( - <MentionList id='reply_textbox' />, - document.getElementById('reply_mention_tab') - ); - - ReactDOM.render( - <MentionList id='edit_textbox' />, - document.getElementById('edit_mention_tab') - ); - // // Modals // |