From 1f46cca65ca0669c1fc1a6fec5113f835a1a3023 Mon Sep 17 00:00:00 2001
From: Harrison Healey <harrisonmhealey@gmail.com>
Date: Wed, 23 Mar 2016 13:03:12 -0400
Subject: Changed PreferenceStore to store data in memory

---
 webapp/components/tutorial/tutorial_intro_screens.jsx | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

(limited to 'webapp/components/tutorial/tutorial_intro_screens.jsx')

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) {
-- 
cgit v1.2.3-1-g7c22

