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/Request.js | |
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/Request.js')
-rw-r--r-- | src/stores/lib/Request.js | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/stores/lib/Request.js b/src/stores/lib/Request.js index e58341790..60c943a42 100644 --- a/src/stores/lib/Request.js +++ b/src/stores/lib/Request.js | |||
@@ -18,6 +18,18 @@ export default class Request { | |||
18 | 18 | ||
19 | @observable wasExecuted = false; | 19 | @observable wasExecuted = false; |
20 | 20 | ||
21 | @action _reset() { | ||
22 | this.error = null; | ||
23 | this.result = null; | ||
24 | this.isExecuting = false; | ||
25 | this.isError = false; | ||
26 | this.wasExecuted = false; | ||
27 | this._isWaitingForResponse = false; | ||
28 | this._promise = Promise; | ||
29 | |||
30 | return this; | ||
31 | } | ||
32 | |||
21 | _promise = Promise; | 33 | _promise = Promise; |
22 | 34 | ||
23 | _api = {}; | 35 | _api = {}; |
@@ -139,15 +151,5 @@ export default class Request { | |||
139 | for (const hook of Request._hooks) hook(this); | 151 | for (const hook of Request._hooks) hook(this); |
140 | } | 152 | } |
141 | 153 | ||
142 | reset = () => { | 154 | reset = () => this._reset(); |
143 | this.error = null; | ||
144 | this.result = null; | ||
145 | this.isExecuting = false; | ||
146 | this.isError = false; | ||
147 | this.wasExecuted = false; | ||
148 | this._isWaitingForResponse = false; | ||
149 | this._promise = Promise; | ||
150 | |||
151 | return this; | ||
152 | }; | ||
153 | } | 155 | } |