diff options
Diffstat (limited to 'src/stores/FeaturesStore.ts')
-rw-r--r-- | src/stores/FeaturesStore.ts | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/stores/FeaturesStore.ts b/src/stores/FeaturesStore.ts index b63c252df..ed0c6c17b 100644 --- a/src/stores/FeaturesStore.ts +++ b/src/stores/FeaturesStore.ts | |||
@@ -1,5 +1,14 @@ | |||
1 | import { computed, observable, runInAction } from 'mobx'; | 1 | import { |
2 | action, | ||
3 | computed, | ||
4 | makeObservable, | ||
5 | observable, | ||
6 | runInAction, | ||
7 | } from 'mobx'; | ||
2 | 8 | ||
9 | import { Stores } from '../@types/stores.types'; | ||
10 | import { ApiInterface } from '../api'; | ||
11 | import { Actions } from '../actions/lib/actions'; | ||
3 | import CachedRequest from './lib/CachedRequest'; | 12 | import CachedRequest from './lib/CachedRequest'; |
4 | import serviceProxy from '../features/serviceProxy'; | 13 | import serviceProxy from '../features/serviceProxy'; |
5 | import basicAuth from '../features/basicAuth'; | 14 | import basicAuth from '../features/basicAuth'; |
@@ -24,6 +33,12 @@ export default class FeaturesStore extends TypedStore { | |||
24 | 33 | ||
25 | @observable features = {}; | 34 | @observable features = {}; |
26 | 35 | ||
36 | constructor(stores: Stores, api: ApiInterface, actions: Actions) { | ||
37 | super(stores, api, actions); | ||
38 | |||
39 | makeObservable(this); | ||
40 | } | ||
41 | |||
27 | async setup(): Promise<void> { | 42 | async setup(): Promise<void> { |
28 | this.registerReactions([ | 43 | this.registerReactions([ |
29 | this._updateFeatures, | 44 | this._updateFeatures, |
@@ -49,9 +64,11 @@ export default class FeaturesStore extends TypedStore { | |||
49 | } | 64 | } |
50 | Object.assign(features, requestResult); | 65 | Object.assign(features, requestResult); |
51 | } | 66 | } |
52 | runInAction('FeaturesStore::_updateFeatures', () => { | 67 | runInAction( |
53 | this.features = features; | 68 | action('FeaturesStore::_updateFeatures', () => { |
54 | }); | 69 | this.features = features; |
70 | }), | ||
71 | ); | ||
55 | }; | 72 | }; |
56 | 73 | ||
57 | _monitorLoginStatus(): void { | 74 | _monitorLoginStatus(): void { |