diff options
author | 2019-09-05 11:14:51 +0200 | |
---|---|---|
committer | 2019-09-05 11:14:51 +0200 | |
commit | 4152b7f78687105e759912626ba3c055e70bc304 (patch) | |
tree | bfda77d21041889b5802b0092cc7325ec0b68f8c | |
parent | create test build (diff) | |
download | ferdium-app-4152b7f78687105e759912626ba3c055e70bc304.tar.gz ferdium-app-4152b7f78687105e759912626ba3c055e70bc304.tar.zst ferdium-app-4152b7f78687105e759912626ba3c055e70bc304.zip |
Fix isPro state
-rw-r--r-- | src/components/settings/account/AccountDashboard.js | 4 | ||||
-rw-r--r-- | src/containers/settings/AccountScreen.js | 1 | ||||
-rw-r--r-- | src/environment.js | 12 | ||||
-rw-r--r-- | src/stores/UserStore.js | 6 |
4 files changed, 15 insertions, 8 deletions
diff --git a/src/components/settings/account/AccountDashboard.js b/src/components/settings/account/AccountDashboard.js index 4fd1e8163..ac2594604 100644 --- a/src/components/settings/account/AccountDashboard.js +++ b/src/components/settings/account/AccountDashboard.js | |||
@@ -97,6 +97,7 @@ const messages = defineMessages({ | |||
97 | class AccountDashboard extends Component { | 97 | class AccountDashboard extends Component { |
98 | static propTypes = { | 98 | static propTypes = { |
99 | user: MobxPropTypes.observableObject.isRequired, | 99 | user: MobxPropTypes.observableObject.isRequired, |
100 | isPremiumOverrideUser: PropTypes.bool.isRequired, | ||
100 | isProUser: PropTypes.bool.isRequired, | 101 | isProUser: PropTypes.bool.isRequired, |
101 | isLoading: PropTypes.bool.isRequired, | 102 | isLoading: PropTypes.bool.isRequired, |
102 | userInfoRequestFailed: PropTypes.bool.isRequired, | 103 | userInfoRequestFailed: PropTypes.bool.isRequired, |
@@ -117,6 +118,7 @@ class AccountDashboard extends Component { | |||
117 | render() { | 118 | render() { |
118 | const { | 119 | const { |
119 | user, | 120 | user, |
121 | isPremiumOverrideUser, | ||
120 | isProUser, | 122 | isProUser, |
121 | isLoading, | 123 | isLoading, |
122 | userInfoRequestFailed, | 124 | userInfoRequestFailed, |
@@ -213,7 +215,7 @@ class AccountDashboard extends Component { | |||
213 | {intl.formatMessage(messages.yourLicense)} | 215 | {intl.formatMessage(messages.yourLicense)} |
214 | </H2> | 216 | </H2> |
215 | <p> | 217 | <p> |
216 | {planName} | 218 | {isPremiumOverrideUser ? 'Franz Premium' : planName} |
217 | {user.team.isTrial && ( | 219 | {user.team.isTrial && ( |
218 | <> | 220 | <> |
219 | {' – '} | 221 | {' – '} |
diff --git a/src/containers/settings/AccountScreen.js b/src/containers/settings/AccountScreen.js index 2b5eba91c..9c74cf2ab 100644 --- a/src/containers/settings/AccountScreen.js +++ b/src/containers/settings/AccountScreen.js | |||
@@ -42,6 +42,7 @@ export default @inject('stores', 'actions') @observer class AccountScreen extend | |||
42 | <ErrorBoundary> | 42 | <ErrorBoundary> |
43 | <AccountDashboard | 43 | <AccountDashboard |
44 | user={user.data} | 44 | user={user.data} |
45 | isPremiumOverrideUser={user.isPremiumOverride} | ||
45 | isProUser={user.isPro} | 46 | isProUser={user.isPro} |
46 | isLoading={isLoadingUserInfo} | 47 | isLoading={isLoadingUserInfo} |
47 | isLoadingPlans={isLoadingPlans} | 48 | isLoadingPlans={isLoadingPlans} |
diff --git a/src/environment.js b/src/environment.js index 9ec2acf9f..4be2c7d70 100644 --- a/src/environment.js +++ b/src/environment.js | |||
@@ -1,12 +1,12 @@ | |||
1 | import isDev from 'electron-is-dev'; | 1 | import isDev from 'electron-is-dev'; |
2 | 2 | ||
3 | import { | 3 | import { |
4 | // LIVE_API, | 4 | LIVE_API, |
5 | DEV_API, | 5 | DEV_API, |
6 | LOCAL_API, | 6 | LOCAL_API, |
7 | LOCAL_API_WEBSITE, | 7 | LOCAL_API_WEBSITE, |
8 | DEV_API_WEBSITE, | 8 | DEV_API_WEBSITE, |
9 | // LIVE_API_WEBSITE, | 9 | LIVE_API_WEBSITE, |
10 | LIVE_WS_API, | 10 | LIVE_WS_API, |
11 | LOCAL_WS_API, | 11 | LOCAL_WS_API, |
12 | DEV_WS_API, | 12 | DEV_WS_API, |
@@ -36,11 +36,11 @@ let wsApi; | |||
36 | let web; | 36 | let web; |
37 | let todos; | 37 | let todos; |
38 | if (!isDevMode || (isDevMode && useLiveAPI)) { | 38 | if (!isDevMode || (isDevMode && useLiveAPI)) { |
39 | // api = LIVE_API; | 39 | api = LIVE_API; |
40 | api = DEV_API; | 40 | // api = DEV_API; |
41 | wsApi = LIVE_WS_API; | 41 | wsApi = LIVE_WS_API; |
42 | // web = LIVE_API_WEBSITE; | 42 | web = LIVE_API_WEBSITE; |
43 | web = DEV_API_WEBSITE; | 43 | // web = DEV_API_WEBSITE; |
44 | todos = PRODUCTION_TODOS_FRONTEND_URL; | 44 | todos = PRODUCTION_TODOS_FRONTEND_URL; |
45 | } else if (isDevMode && useLocalAPI) { | 45 | } else if (isDevMode && useLocalAPI) { |
46 | api = LOCAL_API; | 46 | api = LOCAL_API; |
diff --git a/src/stores/UserStore.js b/src/stores/UserStore.js index d44208923..365336cbf 100644 --- a/src/stores/UserStore.js +++ b/src/stores/UserStore.js | |||
@@ -160,6 +160,10 @@ export default class UserStore extends Store { | |||
160 | return !!this.data.isPremium; | 160 | return !!this.data.isPremium; |
161 | } | 161 | } |
162 | 162 | ||
163 | @computed get isPremiumOverride() { | ||
164 | return (!this.team.plan && this.isPremium) || (this.team.state === 'expired' && this.isPremium); | ||
165 | } | ||
166 | |||
163 | @computed get isPersonal() { | 167 | @computed get isPersonal() { |
164 | if (!this.team.plan) return false; | 168 | if (!this.team.plan) return false; |
165 | const plan = getPlan(this.team.plan); | 169 | const plan = getPlan(this.team.plan); |
@@ -168,7 +172,7 @@ export default class UserStore extends Store { | |||
168 | } | 172 | } |
169 | 173 | ||
170 | @computed get isPro() { | 174 | @computed get isPro() { |
171 | if ((!this.team.plan || this.team.state !== 'expired') && this.isPremium) return true; | 175 | if (this.isPremiumOverride) return true; |
172 | 176 | ||
173 | if ((!this.team.plan || this.team.state === 'expired')) return false; | 177 | if ((!this.team.plan || this.team.state === 'expired')) return false; |
174 | const plan = getPlan(this.team.plan); | 178 | const plan = getPlan(this.team.plan); |