aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/RequestStore.ts
diff options
context:
space:
mode:
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;