aboutsummaryrefslogtreecommitdiffstats
path: root/src/api
diff options
context:
space:
mode:
authorLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2022-05-07 13:17:26 -0500
committerLibravatar GitHub <noreply@github.com>2022-05-07 18:17:26 +0000
commita24c037b322dbdc56cbaae3d3fe6f5fa1e819972 (patch)
treedf2125dd4e388c30e5e7a91d02683b86346edfb8 /src/api
parentNew Crowdin updates (#118) [skip ci] (diff)
downloadferdium-app-a24c037b322dbdc56cbaae3d3fe6f5fa1e819972.tar.gz
ferdium-app-a24c037b322dbdc56cbaae3d3fe6f5fa1e819972.tar.zst
ferdium-app-a24c037b322dbdc56cbaae3d3fe6f5fa1e819972.zip
New fix for fixing URLs with '//' (#105)
Diffstat (limited to 'src/api')
-rw-r--r--src/api/apiBase.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/api/apiBase.ts b/src/api/apiBase.ts
index 7ed3616a8..c4acb5f68 100644
--- a/src/api/apiBase.ts
+++ b/src/api/apiBase.ts
@@ -9,6 +9,7 @@ import {
9 LOCAL_SERVER, 9 LOCAL_SERVER,
10 SERVER_NOT_LOADED, 10 SERVER_NOT_LOADED,
11} from '../config'; 11} from '../config';
12import { fixUrl } from '../helpers/url-helpers';
12 13
13// Note: This cannot be used from the internal-server since we are not running within the context of a browser window 14// 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) => { 15const apiBase = (withVersion = true) => {
@@ -28,13 +29,13 @@ const apiBase = (withVersion = true) => {
28 }` 29 }`
29 : (window as any).ferdium.stores.settings.all.app.server; 30 : (window as any).ferdium.stores.settings.all.app.server;
30 31
31 return withVersion ? `${url}/${API_VERSION}` : url; 32 return fixUrl(withVersion ? `${url}/${API_VERSION}` : url);
32}; 33};
33 34
34export default apiBase; 35export default apiBase;
35 36
36export function termsBase() { 37export function termsBase() {
37 return (window as any).ferdium.stores.settings.all.app.server !== LIVE_FRANZ_API 38 return fixUrl((window as any).ferdium.stores.settings.all.app.server !== LIVE_FRANZ_API
38 ? (window as any).ferdium.stores.settings.all.app.server 39 ? (window as any).ferdium.stores.settings.all.app.server
39 : DEV_API_FRANZ_WEBSITE; 40 : DEV_API_FRANZ_WEBSITE);
40} 41}