aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/apiBase.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/apiBase.ts')
-rw-r--r--src/api/apiBase.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/api/apiBase.ts b/src/api/apiBase.ts
index a30793848..c41fbe8ba 100644
--- a/src/api/apiBase.ts
+++ b/src/api/apiBase.ts
@@ -13,20 +13,20 @@ import {
13// Note: This cannot be used from the internal-server since we are not running within the context of a browser window 13// Note: This cannot be used from the internal-server since we are not running within the context of a browser window
14const apiBase = (withVersion = true) => { 14const apiBase = (withVersion = true) => {
15 if ( 15 if (
16 !(window as any).ferdi || 16 !(window as any).ferdium ||
17 !(window as any).ferdi.stores.settings || 17 !(window as any).ferdium.stores.settings ||
18 !(window as any).ferdi.stores.settings.all || 18 !(window as any).ferdium.stores.settings.all ||
19 !(window as any).ferdi.stores.settings.all.app.server 19 !(window as any).ferdium.stores.settings.all.app.server
20 ) { 20 ) {
21 // Stores have not yet been loaded - return SERVER_NOT_LOADED to force a retry when stores are loaded 21 // Stores have not yet been loaded - return SERVER_NOT_LOADED to force a retry when stores are loaded
22 return SERVER_NOT_LOADED; 22 return SERVER_NOT_LOADED;
23 } 23 }
24 const url = 24 const url =
25 (window as any).ferdi.stores.settings.all.app.server === LOCAL_SERVER 25 (window as any).ferdium.stores.settings.all.app.server === LOCAL_SERVER
26 ? `http://${LOCAL_HOSTNAME}:${ 26 ? `http://${LOCAL_HOSTNAME}:${
27 (window as any).ferdi.stores.requests.localServerPort 27 (window as any).ferdium.stores.requests.localServerPort
28 }` 28 }`
29 : (window as any).ferdi.stores.settings.all.app.server; 29 : (window as any).ferdium.stores.settings.all.app.server;
30 30
31 return withVersion ? `${url}/${API_VERSION}` : url; 31 return withVersion ? `${url}/${API_VERSION}` : url;
32}; 32};
@@ -34,8 +34,8 @@ const apiBase = (withVersion = true) => {
34export default apiBase; 34export default apiBase;
35 35
36export function termsBase() { 36export function termsBase() {
37 // TODO: This needs to handle local vs ferdi vs franz servers 37 // TODO: This needs to handle local vs ferdium vs franz servers
38 return (window as any).ferdi.stores.settings.all.app.server !== LIVE_FRANZ_API 38 return (window as any).ferdium.stores.settings.all.app.server !== LIVE_FRANZ_API
39 ? (window as any).ferdi.stores.settings.all.app.server 39 ? (window as any).ferdium.stores.settings.all.app.server
40 : DEV_API_FRANZ_WEBSITE; 40 : DEV_API_FRANZ_WEBSITE;
41} 41}