diff options
Diffstat (limited to 'src/stores/UserStore.js')
-rw-r--r-- | src/stores/UserStore.js | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/src/stores/UserStore.js b/src/stores/UserStore.js index b652098f9..e1d9672b6 100644 --- a/src/stores/UserStore.js +++ b/src/stores/UserStore.js | |||
@@ -8,7 +8,6 @@ import { isDevMode } from '../environment'; | |||
8 | import Store from './lib/Store'; | 8 | import Store from './lib/Store'; |
9 | import Request from './lib/Request'; | 9 | import Request from './lib/Request'; |
10 | import CachedRequest from './lib/CachedRequest'; | 10 | import CachedRequest from './lib/CachedRequest'; |
11 | import { gaEvent } from '../lib/analytics'; | ||
12 | import { sleep } from '../helpers/async-helpers'; | 11 | import { sleep } from '../helpers/async-helpers'; |
13 | import { getPlan } from '../helpers/plan-helpers'; | 12 | import { getPlan } from '../helpers/plan-helpers'; |
14 | import { PLANS } from '../config'; | 13 | import { PLANS } from '../config'; |
@@ -94,7 +93,7 @@ export default class UserStore extends Store { | |||
94 | 93 | ||
95 | // Reactions | 94 | // Reactions |
96 | this.registerReactions([ | 95 | this.registerReactions([ |
97 | this._requireAuthenticatedUser, | 96 | // this._requireAuthenticatedUser, |
98 | this._getUserData.bind(this), | 97 | this._getUserData.bind(this), |
99 | this._resetTrialActivationState.bind(this), | 98 | this._resetTrialActivationState.bind(this), |
100 | ]); | 99 | ]); |
@@ -190,16 +189,12 @@ export default class UserStore extends Store { | |||
190 | this._setUserData(authToken); | 189 | this._setUserData(authToken); |
191 | 190 | ||
192 | this.stores.router.push('/'); | 191 | this.stores.router.push('/'); |
193 | |||
194 | gaEvent('User', 'login'); | ||
195 | } | 192 | } |
196 | 193 | ||
197 | @action _tokenLogin(authToken) { | 194 | @action _tokenLogin(authToken) { |
198 | this._setUserData(authToken); | 195 | this._setUserData(authToken); |
199 | 196 | ||
200 | this.stores.router.push('/'); | 197 | this.stores.router.push('/'); |
201 | |||
202 | gaEvent('User', 'tokenLogin'); | ||
203 | } | 198 | } |
204 | 199 | ||
205 | @action async _signup({ | 200 | @action async _signup({ |
@@ -215,13 +210,11 @@ export default class UserStore extends Store { | |||
215 | locale: this.stores.app.locale, | 210 | locale: this.stores.app.locale, |
216 | }); | 211 | }); |
217 | 212 | ||
218 | this.hasCompletedSignup = false; | 213 | this.hasCompletedSignup = true; |
219 | 214 | ||
220 | this._setUserData(authToken); | 215 | this._setUserData(authToken); |
221 | 216 | ||
222 | this.stores.router.push(this.PRICING_ROUTE); | 217 | this.stores.router.push('/'); |
223 | |||
224 | gaEvent('User', 'signup'); | ||
225 | } | 218 | } |
226 | 219 | ||
227 | @action async _retrievePassword({ email }) { | 220 | @action async _retrievePassword({ email }) { |
@@ -229,8 +222,6 @@ export default class UserStore extends Store { | |||
229 | 222 | ||
230 | await request._promise; | 223 | await request._promise; |
231 | this.actionStatus = request.result.status || []; | 224 | this.actionStatus = request.result.status || []; |
232 | |||
233 | gaEvent('User', 'retrievePassword'); | ||
234 | } | 225 | } |
235 | 226 | ||
236 | @action async _activateTrial({ planId }) { | 227 | @action async _activateTrial({ planId }) { |
@@ -246,9 +237,6 @@ export default class UserStore extends Store { | |||
246 | 237 | ||
247 | this.stores.features.featuresRequest.invalidate({ immediately: true }); | 238 | this.stores.features.featuresRequest.invalidate({ immediately: true }); |
248 | this.stores.user.getUserInfoRequest.invalidate({ immediately: true }); | 239 | this.stores.user.getUserInfoRequest.invalidate({ immediately: true }); |
249 | |||
250 | |||
251 | gaEvent('User', 'activateTrial'); | ||
252 | } | 240 | } |
253 | 241 | ||
254 | @action async _invite({ invites }) { | 242 | @action async _invite({ invites }) { |
@@ -262,8 +250,6 @@ export default class UserStore extends Store { | |||
262 | if (this.stores.router.location.pathname.includes(this.INVITE_ROUTE)) { | 250 | if (this.stores.router.location.pathname.includes(this.INVITE_ROUTE)) { |
263 | this.stores.router.push('/'); | 251 | this.stores.router.push('/'); |
264 | } | 252 | } |
265 | |||
266 | gaEvent('User', 'inviteUsers'); | ||
267 | } | 253 | } |
268 | 254 | ||
269 | @action async _update({ userData }) { | 255 | @action async _update({ userData }) { |
@@ -273,8 +259,6 @@ export default class UserStore extends Store { | |||
273 | 259 | ||
274 | this.getUserInfoRequest.patch(() => response.data); | 260 | this.getUserInfoRequest.patch(() => response.data); |
275 | this.actionStatus = response.status || []; | 261 | this.actionStatus = response.status || []; |
276 | |||
277 | gaEvent('User', 'update'); | ||
278 | } | 262 | } |
279 | 263 | ||
280 | @action _resetStatus() { | 264 | @action _resetStatus() { |
@@ -297,12 +281,12 @@ export default class UserStore extends Store { | |||
297 | const recipes = services.filter((obj, pos, arr) => arr.map(mapObj => mapObj.recipe.id).indexOf(obj.recipe.id) === pos).map(s => s.recipe.id); | 281 | const recipes = services.filter((obj, pos, arr) => arr.map(mapObj => mapObj.recipe.id).indexOf(obj.recipe.id) === pos).map(s => s.recipe.id); |
298 | 282 | ||
299 | // Install recipes | 283 | // Install recipes |
300 | for (const recipe of recipes) { | 284 | for (const recipe of recipes) { // eslint-disable-line no-unused-vars |
301 | // eslint-disable-next-line | 285 | // eslint-disable-next-line |
302 | await this.stores.recipes._install({ recipeId: recipe }); | 286 | await this.stores.recipes._install({ recipeId: recipe }); |
303 | } | 287 | } |
304 | 288 | ||
305 | for (const service of services) { | 289 | for (const service of services) { // eslint-disable-line no-unused-vars |
306 | this.actions.service.createFromLegacyService({ | 290 | this.actions.service.createFromLegacyService({ |
307 | data: service, | 291 | data: service, |
308 | }); | 292 | }); |