aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/UserStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/stores/UserStore.js')
-rw-r--r--src/stores/UserStore.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/stores/UserStore.js b/src/stores/UserStore.js
index f3dfbdbf0..7ac7d2375 100644
--- a/src/stores/UserStore.js
+++ b/src/stores/UserStore.js
@@ -10,6 +10,8 @@ import Request from './lib/Request';
10import CachedRequest from './lib/CachedRequest'; 10import CachedRequest from './lib/CachedRequest';
11import { gaEvent } from '../lib/analytics'; 11import { gaEvent } from '../lib/analytics';
12import { sleep } from '../helpers/async-helpers'; 12import { sleep } from '../helpers/async-helpers';
13import { getPlan } from '../helpers/plan-helpers';
14import { PLANS } from '../config';
13 15
14const debug = require('debug')('Franz:UserStore'); 16const debug = require('debug')('Franz:UserStore');
15 17
@@ -150,10 +152,30 @@ export default class UserStore extends Store {
150 return this.getUserInfoRequest.execute().result || {}; 152 return this.getUserInfoRequest.execute().result || {};
151 } 153 }
152 154
155 @computed get team() {
156 return this.data.team || null;
157 }
158
153 @computed get isPremium() { 159 @computed get isPremium() {
154 return !!this.data.isPremium; 160 return !!this.data.isPremium;
155 } 161 }
156 162
163 @computed get isPersonal() {
164 if (!this.team.plan) return false;
165 const plan = getPlan(this.team.plan);
166
167 return plan === PLANS.PERSONAL;
168 }
169
170 @computed get isPro() {
171 if (!this.team.plan && this.isPremium) return true;
172
173 if (!this.team.plan) return false;
174 const plan = getPlan(this.team.plan);
175
176 return plan === PLANS.PRO;
177 }
178
157 @computed get legacyServices() { 179 @computed get legacyServices() {
158 return this.getLegacyServicesRequest.execute() || {}; 180 return this.getLegacyServicesRequest.execute() || {};
159 } 181 }