From 45373f655f68fdd0b320cde175b6108454ad4731 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Sat, 17 Jul 2021 20:32:22 +0530 Subject: Removed Franz paid plans features: - serviceLimit - planSelection - trialStatusBar and other Franz features that were for different tiers of subscription. --- src/stores/UserStore.js | 65 +------------------------------------------------ 1 file changed, 1 insertion(+), 64 deletions(-) (limited to 'src/stores/UserStore.js') diff --git a/src/stores/UserStore.js b/src/stores/UserStore.js index 7947e5a27..8a525c2ef 100644 --- a/src/stores/UserStore.js +++ b/src/stores/UserStore.js @@ -2,16 +2,13 @@ import { observable, computed, action } from 'mobx'; import moment from 'moment'; import jwt from 'jsonwebtoken'; import localStorage from 'mobx-localstorage'; -import ms from 'ms'; import { session } from '@electron/remote'; import { isDevMode } from '../environment'; import Store from './lib/Store'; import Request from './lib/Request'; import CachedRequest from './lib/CachedRequest'; -import { sleep } from '../helpers/async-helpers'; -import { getPlan } from '../helpers/plan-helpers'; -import { PLANS, TODOS_PARTITION_ID } from '../config'; +import { TODOS_PARTITION_ID } from '../config'; const debug = require('debug')('Ferdi:UserStore'); @@ -27,8 +24,6 @@ export default class UserStore extends Store { SIGNUP_ROUTE = `${this.BASE_ROUTE}/signup`; - PRICING_ROUTE = `${this.BASE_ROUTE}/signup/pricing`; - SETUP_ROUTE = `${this.BASE_ROUTE}/signup/setup`; IMPORT_ROUTE = `${this.BASE_ROUTE}/signup/import`; @@ -45,8 +40,6 @@ export default class UserStore extends Store { @observable passwordRequest = new Request(this.api.user, 'password'); - @observable activateTrialRequest = new Request(this.api.user, 'activateTrial'); - @observable inviteRequest = new Request(this.api.user, 'invite'); @observable getUserInfoRequest = new CachedRequest(this.api.user, 'getInfo'); @@ -71,8 +64,6 @@ export default class UserStore extends Store { @observable hasCompletedSignup = false; - @observable hasActivatedTrial = false; - @observable userData = {}; @observable actionStatus = []; @@ -93,7 +84,6 @@ export default class UserStore extends Store { this.actions.user.retrievePassword.listen(this._retrievePassword.bind(this)); this.actions.user.logout.listen(this._logout.bind(this)); this.actions.user.signup.listen(this._signup.bind(this)); - this.actions.user.activateTrial.listen(this._activateTrial.bind(this)); this.actions.user.invite.listen(this._invite.bind(this)); this.actions.user.update.listen(this._update.bind(this)); this.actions.user.resetStatus.listen(this._resetStatus.bind(this)); @@ -104,7 +94,6 @@ export default class UserStore extends Store { this.registerReactions([ this._requireAuthenticatedUser.bind(this), this._getUserData.bind(this), - this._resetTrialActivationState.bind(this), ]); } @@ -126,10 +115,6 @@ export default class UserStore extends Store { return this.SIGNUP_ROUTE; } - get pricingRoute() { - return this.PRICING_ROUTE; - } - get setupRoute() { return this.SETUP_ROUTE; } @@ -172,31 +157,6 @@ export default class UserStore extends Store { return this.data.team || null; } - @computed get isPremium() { - return true; - } - - @computed get isPremiumOverride() { - return ((!this.team || !this.team.plan) && this.isPremium) || (this.team && this.team.state === 'expired' && this.isPremium); - } - - @computed get isPersonal() { - if (!this.team || !this.team.plan) return false; - const plan = getPlan(this.team.plan); - - return plan === PLANS.PERSONAL; - } - - @computed get isPro() { - return true; - // if (this.isPremiumOverride) return true; - - // if (!this.team || (!this.team.plan || this.team.state === 'expired')) return false; - // const plan = getPlan(this.team.plan); - - // return plan === PLANS.PRO || plan === PLANS.LEGACY; - } - @computed get legacyServices() { return this.getLegacyServicesRequest.execute() || {}; } @@ -244,21 +204,6 @@ export default class UserStore extends Store { this.actionStatus = request.result.status || []; } - @action async _activateTrial({ planId }) { - debug('activate trial', planId); - - this.activateTrialRequest.execute({ - plan: planId, - }); - - await this.activateTrialRequest._promise; - - this.hasActivatedTrial = true; - - this.stores.features.featuresRequest.invalidate({ immediately: true }); - this.stores.user.getUserInfoRequest.invalidate({ immediately: true }); - } - @action async _invite({ invites }) { const data = invites.filter(invite => invite.email !== ''); @@ -386,14 +331,6 @@ export default class UserStore extends Store { } } - async _resetTrialActivationState() { - if (this.hasActivatedTrial) { - await sleep(ms('12s')); - - this.hasActivatedTrial = false; - } - } - // Helpers _parseToken(authToken) { try { -- cgit v1.2.3-54-g00ecf