diff options
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/RequestStore.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/stores/RequestStore.ts b/src/stores/RequestStore.ts index a964c5d12..59982c05a 100644 --- a/src/stores/RequestStore.ts +++ b/src/stores/RequestStore.ts | |||
@@ -6,7 +6,7 @@ import { Actions } from '../actions/lib/actions'; | |||
6 | import { ApiInterface } from '../api'; | 6 | import { ApiInterface } from '../api'; |
7 | import { Stores } from '../@types/stores.types'; | 7 | import { Stores } from '../@types/stores.types'; |
8 | import CachedRequest from './lib/CachedRequest'; | 8 | import CachedRequest from './lib/CachedRequest'; |
9 | import { LOCAL_PORT } from '../config'; | 9 | import { LOCAL_HOSTNAME, LOCAL_PORT } from '../config'; |
10 | 10 | ||
11 | import TypedStore from './lib/TypedStore'; | 11 | import TypedStore from './lib/TypedStore'; |
12 | 12 | ||
@@ -21,6 +21,8 @@ export default class RequestStore extends TypedStore { | |||
21 | 21 | ||
22 | @observable localServerPort = LOCAL_PORT; | 22 | @observable localServerPort = LOCAL_PORT; |
23 | 23 | ||
24 | @observable localServerToken: string | undefined; | ||
25 | |||
24 | retries: number = 0; | 26 | retries: number = 0; |
25 | 27 | ||
26 | retryDelay: number = ms('2s'); | 28 | retryDelay: number = ms('2s'); |
@@ -45,6 +47,9 @@ export default class RequestStore extends TypedStore { | |||
45 | if (data.port) { | 47 | if (data.port) { |
46 | this.localServerPort = data.port; | 48 | this.localServerPort = data.port; |
47 | } | 49 | } |
50 | if (data.token) { | ||
51 | this.localServerToken = data.token; | ||
52 | } | ||
48 | }); | 53 | }); |
49 | } | 54 | } |
50 | 55 | ||
@@ -56,6 +61,10 @@ export default class RequestStore extends TypedStore { | |||
56 | return this.userInfoRequest.isExecuting || this.servicesRequest.isExecuting; | 61 | return this.userInfoRequest.isExecuting || this.servicesRequest.isExecuting; |
57 | } | 62 | } |
58 | 63 | ||
64 | @computed get localServerOrigin(): string { | ||
65 | return `http://${LOCAL_HOSTNAME}:${this.localServerPort}`; | ||
66 | } | ||
67 | |||
59 | @action _retryRequiredRequests(): void { | 68 | @action _retryRequiredRequests(): void { |
60 | this.userInfoRequest.reload(); | 69 | this.userInfoRequest.reload(); |
61 | this.servicesRequest.reload(); | 70 | this.servicesRequest.reload(); |