diff options
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/apiBase.ts | 20 | ||||
-rw-r--r-- | src/api/server/LocalApi.ts | 2 | ||||
-rw-r--r-- | src/api/server/ServerApi.ts | 2 | ||||
-rw-r--r-- | src/api/utils/auth.ts | 6 |
4 files changed, 15 insertions, 15 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 |
14 | const apiBase = (withVersion = true) => { | 14 | const 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) => { | |||
34 | export default apiBase; | 34 | export default apiBase; |
35 | 35 | ||
36 | export function termsBase() { | 36 | export 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 | } |
diff --git a/src/api/server/LocalApi.ts b/src/api/server/LocalApi.ts index 1a46aaefe..5e205cbe4 100644 --- a/src/api/server/LocalApi.ts +++ b/src/api/server/LocalApi.ts | |||
@@ -4,7 +4,7 @@ import fastFolderSize from 'fast-folder-size'; | |||
4 | 4 | ||
5 | import { getServicePartitionsDirectory } from '../../helpers/service-helpers'; | 5 | import { getServicePartitionsDirectory } from '../../helpers/service-helpers'; |
6 | 6 | ||
7 | const debug = require('debug')('Ferdi:LocalApi'); | 7 | const debug = require('debug')('Ferdium:LocalApi'); |
8 | 8 | ||
9 | export default class LocalApi { | 9 | export default class LocalApi { |
10 | // Settings | 10 | // Settings |
diff --git a/src/api/server/ServerApi.ts b/src/api/server/ServerApi.ts index 706520cb3..9dc3a9a0e 100644 --- a/src/api/server/ServerApi.ts +++ b/src/api/server/ServerApi.ts | |||
@@ -35,7 +35,7 @@ import { | |||
35 | 35 | ||
36 | import { removeServicePartitionDirectory } from '../../helpers/service-helpers'; | 36 | import { removeServicePartitionDirectory } from '../../helpers/service-helpers'; |
37 | 37 | ||
38 | const debug = require('debug')('Ferdi:ServerApi'); | 38 | const debug = require('debug')('Ferdium:ServerApi'); |
39 | 39 | ||
40 | module.paths.unshift(getDevRecipeDirectory(), getRecipeDirectory()); | 40 | module.paths.unshift(getDevRecipeDirectory(), getRecipeDirectory()); |
41 | 41 | ||
diff --git a/src/api/utils/auth.ts b/src/api/utils/auth.ts index 899881e88..a7a73309d 100644 --- a/src/api/utils/auth.ts +++ b/src/api/utils/auth.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import localStorage from 'mobx-localstorage'; | 1 | import localStorage from 'mobx-localstorage'; |
2 | import { ferdiLocale, ferdiVersion } from '../../environment-remote'; | 2 | import { ferdiumLocale, ferdiumVersion } from '../../environment-remote'; |
3 | 3 | ||
4 | export const prepareAuthRequest = ( | 4 | export const prepareAuthRequest = ( |
5 | // eslint-disable-next-line unicorn/no-object-as-default-parameter | 5 | // eslint-disable-next-line unicorn/no-object-as-default-parameter |
@@ -11,10 +11,10 @@ export const prepareAuthRequest = ( | |||
11 | headers: { | 11 | headers: { |
12 | 'Content-Type': 'application/json', | 12 | 'Content-Type': 'application/json', |
13 | 'X-Franz-Source': 'desktop', | 13 | 'X-Franz-Source': 'desktop', |
14 | 'X-Franz-Version': ferdiVersion, | 14 | 'X-Franz-Version': ferdiumVersion, |
15 | 'X-Franz-platform': process.platform, | 15 | 'X-Franz-platform': process.platform, |
16 | 'X-Franz-Timezone-Offset': new Date().getTimezoneOffset(), | 16 | 'X-Franz-Timezone-Offset': new Date().getTimezoneOffset(), |
17 | 'X-Franz-System-Locale': ferdiLocale, | 17 | 'X-Franz-System-Locale': ferdiumLocale, |
18 | // @ts-expect-error Property 'headers' does not exist on type '{ method: string; }'. | 18 | // @ts-expect-error Property 'headers' does not exist on type '{ method: string; }'. |
19 | ...options.headers, | 19 | ...options.headers, |
20 | }, | 20 | }, |