aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/RequestStore.ts
diff options
context:
space:
mode:
authorLibravatar André Oliveira <37463445+SpecialAro@users.noreply.github.com>2022-08-04 00:12:03 +0100
committerLibravatar GitHub <noreply@github.com>2022-08-03 23:12:03 +0000
commitc2509e860752e23812bb408e331c02c918aadd54 (patch)
treeb855163ad1bddaaa19c47a9cea2713c6899ea1a5 /src/stores/RequestStore.ts
parentRevert to older working version of 'macos-notification-state' (diff)
downloadferdium-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/RequestStore.ts')
-rw-r--r--src/stores/RequestStore.ts16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/stores/RequestStore.ts b/src/stores/RequestStore.ts
index 59982c05a..279615e50 100644
--- a/src/stores/RequestStore.ts
+++ b/src/stores/RequestStore.ts
@@ -44,12 +44,7 @@ export default class RequestStore extends TypedStore {
44 this.servicesRequest = this.stores.services.allServicesRequest; 44 this.servicesRequest = this.stores.services.allServicesRequest;
45 45
46 ipcRenderer.on('localServerPort', (_, data) => { 46 ipcRenderer.on('localServerPort', (_, data) => {
47 if (data.port) { 47 this.setData(data);
48 this.localServerPort = data.port;
49 }
50 if (data.token) {
51 this.localServerToken = data.token;
52 }
53 }); 48 });
54 } 49 }
55 50
@@ -70,6 +65,15 @@ export default class RequestStore extends TypedStore {
70 this.servicesRequest.reload(); 65 this.servicesRequest.reload();
71 } 66 }
72 67
68 @action setData(data: { port: number; token: string | undefined }): void {
69 if (data.port) {
70 this.localServerPort = data.port;
71 }
72 if (data.token) {
73 this.localServerToken = data.token;
74 }
75 }
76
73 // Reactions 77 // Reactions
74 _autoRetry(): void { 78 _autoRetry(): void {
75 const delay = (this.retries <= 10 ? this.retries : 10) * this.retryDelay; 79 const delay = (this.retries <= 10 ? this.retries : 10) * this.retryDelay;