summaryrefslogtreecommitdiffstats
path: root/web/react
diff options
context:
space:
mode:
Diffstat (limited to 'web/react')
-rw-r--r--web/react/components/create_post.jsx16
1 files changed, 11 insertions, 5 deletions
diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx
index e54f1016d..e901b272a 100644
--- a/web/react/components/create_post.jsx
+++ b/web/react/components/create_post.jsx
@@ -52,7 +52,6 @@ export default class CreatePost extends React.Component {
PostStore.clearDraftUploads();
const draft = this.getCurrentDraft();
- const tutorialStep = PreferenceStore.getInt(Preferences.TUTORIAL_STEP, UserStore.getCurrentId(), 999);
this.state = {
channelId: ChannelStore.getCurrentId(),
@@ -63,11 +62,9 @@ export default class CreatePost extends React.Component {
initialText: draft.messageText,
windowWidth: Utils.windowWidth(),
windowHeight: Utils.windowHeight(),
- ctrlSend: PreferenceStore.getBool(Constants.Preferences.CATEGORY_ADVANCED_SETTINGS, 'send_on_ctrl_enter'),
- showTutorialTip: tutorialStep === TutorialSteps.POST_POPOVER
+ ctrlSend: false,
+ showTutorialTip: false
};
-
- PreferenceStore.addChangeListener(this.onPreferenceChange);
}
handleResize() {
this.setState({
@@ -313,6 +310,15 @@ export default class CreatePost extends React.Component {
this.setState({previews, uploadsInProgress});
}
+ componentWillMount() {
+ const tutorialStep = PreferenceStore.getInt(Preferences.TUTORIAL_STEP, UserStore.getCurrentId(), 999);
+
+ // wait to load these since they may have changed since the component was constructed (particularly in the case of skipping the tutorial)
+ this.setState({
+ ctrlSend: PreferenceStore.getBool(Constants.Preferences.CATEGORY_ADVANCED_SETTINGS, 'send_on_ctrl_enter'),
+ showTutorialTip: tutorialStep === TutorialSteps.POST_POPOVER
+ });
+ }
componentDidMount() {
ChannelStore.addChangeListener(this.onChange);
PreferenceStore.addChangeListener(this.onPreferenceChange);