diff options
author | Stefan Malzner <stefan@adlk.io> | 2019-09-03 20:33:00 +0200 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2019-09-03 20:33:00 +0200 |
commit | 3ca3e36cf7fce6b241e242a07cb4731760ee4265 (patch) | |
tree | 0796a3712aebbf695545892be19fc677e7acec8e /src/models | |
parent | Automatic i18n update (i18n.meetfranz.com) (diff) | |
parent | Update en-US.json (diff) | |
download | ferdium-app-3ca3e36cf7fce6b241e242a07cb4731760ee4265.tar.gz ferdium-app-3ca3e36cf7fce6b241e242a07cb4731760ee4265.tar.zst ferdium-app-3ca3e36cf7fce6b241e242a07cb4731760ee4265.zip |
Merge branch 'develop' into i18n
Diffstat (limited to 'src/models')
-rw-r--r-- | src/models/Service.js | 15 | ||||
-rw-r--r-- | src/models/User.js | 14 |
2 files changed, 28 insertions, 1 deletions
diff --git a/src/models/Service.js b/src/models/Service.js index 88bce3360..848a84aa2 100644 --- a/src/models/Service.js +++ b/src/models/Service.js | |||
@@ -4,6 +4,11 @@ import normalizeUrl from 'normalize-url'; | |||
4 | 4 | ||
5 | const debug = require('debug')('Franz:Service'); | 5 | const debug = require('debug')('Franz:Service'); |
6 | 6 | ||
7 | export const RESTRICTION_TYPES = { | ||
8 | SERVICE_LIMIT: 0, | ||
9 | CUSTOM_URL: 1, | ||
10 | }; | ||
11 | |||
7 | export default class Service { | 12 | export default class Service { |
8 | id = ''; | 13 | id = ''; |
9 | 14 | ||
@@ -59,6 +64,12 @@ export default class Service { | |||
59 | 64 | ||
60 | @observable errorMessage = ''; | 65 | @observable errorMessage = ''; |
61 | 66 | ||
67 | @observable isUsingCustomUrl = false; | ||
68 | |||
69 | @observable isServiceAccessRestricted = false; | ||
70 | |||
71 | @observable restrictionType = null; | ||
72 | |||
62 | constructor(data, recipe) { | 73 | constructor(data, recipe) { |
63 | if (!data) { | 74 | if (!data) { |
64 | console.error('Service config not valid'); | 75 | console.error('Service config not valid'); |
@@ -111,6 +122,10 @@ export default class Service { | |||
111 | this.unreadDirectMessageCount = 0; | 122 | this.unreadDirectMessageCount = 0; |
112 | this.unreadIndirectMessageCount = 0; | 123 | this.unreadIndirectMessageCount = 0; |
113 | } | 124 | } |
125 | |||
126 | if (this.recipe.hasCustomUrl && this.customUrl) { | ||
127 | this.isUsingCustomUrl = true; | ||
128 | } | ||
114 | }); | 129 | }); |
115 | } | 130 | } |
116 | 131 | ||
diff --git a/src/models/User.js b/src/models/User.js index bec78fc16..0a2b1f62a 100644 --- a/src/models/User.js +++ b/src/models/User.js | |||
@@ -20,6 +20,10 @@ export default class User { | |||
20 | 20 | ||
21 | @observable isSubscriptionOwner = false; | 21 | @observable isSubscriptionOwner = false; |
22 | 22 | ||
23 | @observable hasSubscription = false; | ||
24 | |||
25 | @observable hadSubscription = false; | ||
26 | |||
23 | @observable isPremium = false; | 27 | @observable isPremium = false; |
24 | 28 | ||
25 | @observable beta = false; | 29 | @observable beta = false; |
@@ -32,6 +36,9 @@ export default class User { | |||
32 | 36 | ||
33 | @observable locale = false; | 37 | @observable locale = false; |
34 | 38 | ||
39 | @observable team = {}; | ||
40 | |||
41 | |||
35 | constructor(data) { | 42 | constructor(data) { |
36 | if (!data.id) { | 43 | if (!data.id) { |
37 | throw Error('User requires Id'); | 44 | throw Error('User requires Id'); |
@@ -47,8 +54,13 @@ export default class User { | |||
47 | this.beta = data.beta || this.beta; | 54 | this.beta = data.beta || this.beta; |
48 | this.donor = data.donor || this.donor; | 55 | this.donor = data.donor || this.donor; |
49 | this.isDonor = data.isDonor || this.isDonor; | 56 | this.isDonor = data.isDonor || this.isDonor; |
50 | this.isSubscriptionOwner = data.isSubscriptionOwner || this.isSubscriptionOwner; | ||
51 | this.isMiner = data.isMiner || this.isMiner; | 57 | this.isMiner = data.isMiner || this.isMiner; |
52 | this.locale = data.locale || this.locale; | 58 | this.locale = data.locale || this.locale; |
59 | |||
60 | this.isSubscriptionOwner = data.isSubscriptionOwner || this.isSubscriptionOwner; | ||
61 | this.hasSubscription = data.hasSubscription || this.hasSubscription; | ||
62 | this.hadSubscription = data.hadSubscription || this.hadSubscription; | ||
63 | |||
64 | this.team = data.team || this.team; | ||
53 | } | 65 | } |
54 | } | 66 | } |