diff options
author | André Oliveira <37463445+SpecialAro@users.noreply.github.com> | 2022-08-04 00:12:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-03 23:12:03 +0000 |
commit | c2509e860752e23812bb408e331c02c918aadd54 (patch) | |
tree | b855163ad1bddaaa19c47a9cea2713c6899ea1a5 /src/stores/lib/TypedStore.ts | |
parent | Revert to older working version of 'macos-notification-state' (diff) | |
download | ferdium-app-c2509e860752e23812bb408e331c02c918aadd54.tar.gz ferdium-app-c2509e860752e23812bb408e331c02c918aadd54.tar.zst ferdium-app-c2509e860752e23812bb408e331c02c918aadd54.zip |
chore: change values inside mobx actions to fix console warnings (#532)
Diffstat (limited to 'src/stores/lib/TypedStore.ts')
-rw-r--r-- | src/stores/lib/TypedStore.ts | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/stores/lib/TypedStore.ts b/src/stores/lib/TypedStore.ts index e44eadd32..0a669e669 100644 --- a/src/stores/lib/TypedStore.ts +++ b/src/stores/lib/TypedStore.ts | |||
@@ -1,4 +1,10 @@ | |||
1 | import { computed, IReactionPublic, makeObservable, observable } from 'mobx'; | 1 | import { |
2 | action, | ||
3 | computed, | ||
4 | IReactionPublic, | ||
5 | makeObservable, | ||
6 | observable, | ||
7 | } from 'mobx'; | ||
2 | import { Actions } from '../../actions/lib/actions'; | 8 | import { Actions } from '../../actions/lib/actions'; |
3 | import { ApiInterface } from '../../api'; | 9 | import { ApiInterface } from '../../api'; |
4 | import { Stores } from '../../@types/stores.types'; | 10 | import { Stores } from '../../@types/stores.types'; |
@@ -15,6 +21,10 @@ export default abstract class TypedStore { | |||
15 | 21 | ||
16 | actions: Actions; | 22 | actions: Actions; |
17 | 23 | ||
24 | @action _setResetStatus() { | ||
25 | this._status = null; | ||
26 | } | ||
27 | |||
18 | @computed get actionStatus() { | 28 | @computed get actionStatus() { |
19 | return this._status || []; | 29 | return this._status || []; |
20 | } | 30 | } |
@@ -49,6 +59,6 @@ export default abstract class TypedStore { | |||
49 | } | 59 | } |
50 | 60 | ||
51 | resetStatus(): void { | 61 | resetStatus(): void { |
52 | this._status = null; | 62 | this._setResetStatus(); |
53 | } | 63 | } |
54 | } | 64 | } |