Correct base URL logic

This commit is contained in:
Alex Holliday committed 2024-10-07 11:06:26 +08:00
1 parent d305c63a27
commit f4a8c226b2
1 file changed
+3 -1
+3 -1
View File
@@ -10,7 +10,9 @@ class NetworkService {
this.setBaseUrl(baseURL);
this.unsubscribe = store.subscribe(() => {
const state = store.getState();
if (BASE_URL === undefined && state.settings.apiBaseUrl) {
if (BASE_URL !== undefined) {
baseURL = BASE_URL;
} else if (state?.settings?.apiBaseUrl ?? null) {
baseURL = state.settings.apiBaseUrl;
} else {
baseURL = FALLBACK_BASE_URL;