aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/FeaturesStore.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/stores/FeaturesStore.ts')
-rw-r--r--src/stores/FeaturesStore.ts25
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 @@
1import { computed, observable, runInAction } from 'mobx'; 1import {
2 action,
3 computed,
4 makeObservable,
5 observable,
6 runInAction,
7} from 'mobx';
2 8
9import { Stores } from '../@types/stores.types';
10import { ApiInterface } from '../api';
11import { Actions } from '../actions/lib/actions';
3import CachedRequest from './lib/CachedRequest'; 12import CachedRequest from './lib/CachedRequest';
4import serviceProxy from '../features/serviceProxy'; 13import serviceProxy from '../features/serviceProxy';
5import basicAuth from '../features/basicAuth'; 14import 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 {