diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-03-23 14:22:30 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-03-23 14:22:30 -0400 |
commit | 6275ad2ae48807738ddd9a28bd69ff3f5ccc1a50 (patch) | |
tree | adee85d0a0e2e09f846fd4890c6b5843728ca165 /webapp/components/tutorial/tutorial_intro_screens.jsx | |
parent | aed690c5891a2cff97cc5fa00648c86be54ed8ee (diff) | |
parent | 1f46cca65ca0669c1fc1a6fec5113f835a1a3023 (diff) | |
download | chat-6275ad2ae48807738ddd9a28bd69ff3f5ccc1a50.tar.gz chat-6275ad2ae48807738ddd9a28bd69ff3f5ccc1a50.tar.bz2 chat-6275ad2ae48807738ddd9a28bd69ff3f5ccc1a50.zip |
Merge pull request #2515 from hmhealey/prefs
Changed PreferenceStore to store data in memory
Diffstat (limited to 'webapp/components/tutorial/tutorial_intro_screens.jsx')
-rw-r--r-- | webapp/components/tutorial/tutorial_intro_screens.jsx | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/webapp/components/tutorial/tutorial_intro_screens.jsx b/webapp/components/tutorial/tutorial_intro_screens.jsx index 5db45523e..734842cad 100644 --- a/webapp/components/tutorial/tutorial_intro_screens.jsx +++ b/webapp/components/tutorial/tutorial_intro_screens.jsx @@ -36,17 +36,22 @@ export default class TutorialIntroScreens extends React.Component { Utils.switchChannel(ChannelStore.getByName(Constants.DEFAULT_CHANNEL)); - let preference = PreferenceStore.getPreference(Preferences.TUTORIAL_STEP, UserStore.getCurrentId(), {value: '0'}); + let step = PreferenceStore.getInt(Preferences.TUTORIAL_STEP, UserStore.getCurrentId(), 0); - const newValue = (parseInt(preference.value, 10) + 1).toString(); - - preference = PreferenceStore.setPreference(Preferences.TUTORIAL_STEP, UserStore.getCurrentId(), newValue); - AsyncClient.savePreferences([preference]); + AsyncClient.savePreference( + Preferences.TUTORIAL_STEP, + UserStore.getCurrentId(), + step + 1 + ); } skipTutorial(e) { e.preventDefault(); - const preference = PreferenceStore.setPreference(Preferences.TUTORIAL_STEP, UserStore.getCurrentId(), '999'); - AsyncClient.savePreferences([preference]); + + AsyncClient.savePreference( + Preferences.TUTORIAL_STEP, + UserStore.getCurrentId(), + 999 + ); } createScreen() { switch (this.state.currentScreen) { |