diff options
Diffstat (limited to 'src/models')
-rw-r--r-- | src/models/News.js | 2 | ||||
-rw-r--r-- | src/models/Plan.js | 2 | ||||
-rw-r--r-- | src/models/RecipePreview.js | 2 | ||||
-rw-r--r-- | src/models/Settings.js | 19 | ||||
-rw-r--r-- | src/models/User.js | 2 |
5 files changed, 23 insertions, 4 deletions
diff --git a/src/models/News.js b/src/models/News.js index e8953ff8c..a96e6550f 100644 --- a/src/models/News.js +++ b/src/models/News.js | |||
@@ -6,7 +6,7 @@ export default class News { | |||
6 | type: string = 'primary'; | 6 | type: string = 'primary'; |
7 | sticky: bool = false; | 7 | sticky: bool = false; |
8 | 8 | ||
9 | constructor(data: Object) { | 9 | constructor(data) { |
10 | if (!data.id) { | 10 | if (!data.id) { |
11 | throw Error('News requires Id'); | 11 | throw Error('News requires Id'); |
12 | } | 12 | } |
diff --git a/src/models/Plan.js b/src/models/Plan.js index 1f2a44902..e77353824 100644 --- a/src/models/Plan.js +++ b/src/models/Plan.js | |||
@@ -10,7 +10,7 @@ export default class Plan { | |||
10 | price: 0, | 10 | price: 0, |
11 | } | 11 | } |
12 | 12 | ||
13 | constructor(data: Object) { | 13 | constructor(data) { |
14 | Object.assign(this, data); | 14 | Object.assign(this, data); |
15 | } | 15 | } |
16 | } | 16 | } |
diff --git a/src/models/RecipePreview.js b/src/models/RecipePreview.js index 7b497edf3..525a5c4b5 100644 --- a/src/models/RecipePreview.js +++ b/src/models/RecipePreview.js | |||
@@ -6,7 +6,7 @@ export default class RecipePreview { | |||
6 | icon: string = ''; // TODO: check if this isn't replaced by `icons` | 6 | icon: string = ''; // TODO: check if this isn't replaced by `icons` |
7 | featured: bool = false; | 7 | featured: bool = false; |
8 | 8 | ||
9 | constructor(data: Object) { | 9 | constructor(data) { |
10 | if (!data.id) { | 10 | if (!data.id) { |
11 | throw Error('RecipePreview requires Id'); | 11 | throw Error('RecipePreview requires Id'); |
12 | } | 12 | } |
diff --git a/src/models/Settings.js b/src/models/Settings.js new file mode 100644 index 000000000..3b352f9aa --- /dev/null +++ b/src/models/Settings.js | |||
@@ -0,0 +1,19 @@ | |||
1 | import { observable } from 'mobx'; | ||
2 | import { DEFAULT_APP_SETTINGS } from '../config'; | ||
3 | |||
4 | export default class Settings { | ||
5 | @observable autoLaunchOnStart = DEFAULT_APP_SETTINGS.autoLaunchOnStart; | ||
6 | @observable autoLaunchInBackground = DEFAULT_APP_SETTINGS.autoLaunchInBackground; | ||
7 | @observable runInBackground = DEFAULT_APP_SETTINGS.runInBackground; | ||
8 | @observable enableSystemTray = DEFAULT_APP_SETTINGS.enableSystemTray; | ||
9 | @observable minimizeToSystemTray = DEFAULT_APP_SETTINGS.minimizeToSystemTray; | ||
10 | @observable showDisabledServices = DEFAULT_APP_SETTINGS.showDisabledServices; | ||
11 | @observable enableSpellchecking = DEFAULT_APP_SETTINGS.enableSpellchecking; | ||
12 | @observable locale = DEFAULT_APP_SETTINGS.locale; | ||
13 | @observable beta = DEFAULT_APP_SETTINGS.beta; | ||
14 | @observable isAppMuted = DEFAULT_APP_SETTINGS.isAppMuted; | ||
15 | |||
16 | constructor(data) { | ||
17 | Object.assign(this, data); | ||
18 | } | ||
19 | } | ||
diff --git a/src/models/User.js b/src/models/User.js index 94b579928..e2d2fc0c8 100644 --- a/src/models/User.js +++ b/src/models/User.js | |||
@@ -16,7 +16,7 @@ export default class User { | |||
16 | @observable isDonor = false; | 16 | @observable isDonor = false; |
17 | @observable isMiner = false; | 17 | @observable isMiner = false; |
18 | 18 | ||
19 | constructor(data: Object) { | 19 | constructor(data) { |
20 | if (!data.id) { | 20 | if (!data.id) { |
21 | throw Error('User requires Id'); | 21 | throw Error('User requires Id'); |
22 | } | 22 | } |