diff options
author | André Oliveira <37463445+SpecialAro@users.noreply.github.com> | 2022-05-16 18:25:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-16 17:25:04 +0000 |
commit | 8ba616544b6dd6aeb63859d79026be82b726294d (patch) | |
tree | 11c1302e12badae1b30afe4813c5d8657cf19454 /src | |
parent | docs: add santhosh-chinnasamy as a contributor for code (#161) [skip ci] (diff) | |
download | ferdium-app-8ba616544b6dd6aeb63859d79026be82b726294d.tar.gz ferdium-app-8ba616544b6dd6aeb63859d79026be82b726294d.tar.zst ferdium-app-8ba616544b6dd6aeb63859d79026be82b726294d.zip |
Change the termBase for accountless mode (#160)
Diffstat (limited to 'src')
-rw-r--r-- | src/api/apiBase.ts | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/api/apiBase.ts b/src/api/apiBase.ts index c4acb5f68..f66c387a5 100644 --- a/src/api/apiBase.ts +++ b/src/api/apiBase.ts | |||
@@ -5,6 +5,7 @@ import { API_VERSION } from '../environment-remote'; | |||
5 | import { | 5 | import { |
6 | DEV_API_FRANZ_WEBSITE, | 6 | DEV_API_FRANZ_WEBSITE, |
7 | LIVE_FRANZ_API, | 7 | LIVE_FRANZ_API, |
8 | LIVE_FERDIUM_API, | ||
8 | LOCAL_HOSTNAME, | 9 | LOCAL_HOSTNAME, |
9 | LOCAL_SERVER, | 10 | LOCAL_SERVER, |
10 | SERVER_NOT_LOADED, | 11 | SERVER_NOT_LOADED, |
@@ -35,7 +36,21 @@ const apiBase = (withVersion = true) => { | |||
35 | export default apiBase; | 36 | export default apiBase; |
36 | 37 | ||
37 | export function termsBase() { | 38 | export function termsBase() { |
38 | return fixUrl((window as any).ferdium.stores.settings.all.app.server !== LIVE_FRANZ_API | 39 | |
39 | ? (window as any).ferdium.stores.settings.all.app.server | 40 | const serverType = (window as any).ferdium.stores.settings.all.app.server; |
40 | : DEV_API_FRANZ_WEBSITE); | 41 | const noServer = 'You are using Ferdium without a server'; |
42 | |||
43 | let terms; | ||
44 | switch (serverType) { | ||
45 | case LIVE_FRANZ_API: | ||
46 | terms = DEV_API_FRANZ_WEBSITE; | ||
47 | break; | ||
48 | case noServer: | ||
49 | terms = LIVE_FERDIUM_API; | ||
50 | break; | ||
51 | default: | ||
52 | terms = serverType; | ||
53 | } | ||
54 | |||
55 | return fixUrl(terms); | ||
41 | } | 56 | } |