Point notification API base URL at DEFAULT_NOTIFY_API_SERVER.
Keep debug localStorage overrides first; fall back to the dedicated notify-api default instead of APP_SERVER.
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
* Persists overrides in localStorage; production defaults apply when unset.
|
* Persists overrides in localStorage; production defaults apply when unset.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { APP_SERVER } from "@/constants/app";
|
import { DEFAULT_NOTIFY_API_SERVER } from "@/constants/app";
|
||||||
|
|
||||||
const LOG = "[NotificationDebug]";
|
const LOG = "[NotificationDebug]";
|
||||||
const STORAGE_KEY_BACKEND_URL = "notificationDebug.backendBaseUrl";
|
const STORAGE_KEY_BACKEND_URL = "notificationDebug.backendBaseUrl";
|
||||||
@@ -45,7 +45,7 @@ function writeStorage(key: string, value: string | null): void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Backend URL override, or null when using the default app server. */
|
/** Backend URL override, or null when using the default Notification API. */
|
||||||
export function getBackendBaseUrl(): string | null {
|
export function getBackendBaseUrl(): string | null {
|
||||||
const raw = readStorage(STORAGE_KEY_BACKEND_URL);
|
const raw = readStorage(STORAGE_KEY_BACKEND_URL);
|
||||||
if (raw === null) {
|
if (raw === null) {
|
||||||
@@ -101,12 +101,15 @@ export function setBypassAuth(enabled: boolean): void {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Base URL for `/notifications/*` API calls.
|
* Base URL for `/notifications/*` API calls.
|
||||||
* Uses debug override when set; otherwise the built-in app server (production default).
|
* Uses debug override when set; otherwise DEFAULT_NOTIFY_API_SERVER.
|
||||||
*/
|
*/
|
||||||
export function getNotificationApiBaseUrl(): string {
|
export function getNotificationApiBaseUrl(): string {
|
||||||
const override = getBackendBaseUrl();
|
const override = getBackendBaseUrl();
|
||||||
if (override) {
|
if (override) {
|
||||||
return override;
|
return override;
|
||||||
}
|
}
|
||||||
return normalizeNotificationBackendUrl(APP_SERVER) ?? APP_SERVER;
|
return (
|
||||||
|
normalizeNotificationBackendUrl(DEFAULT_NOTIFY_API_SERVER) ??
|
||||||
|
DEFAULT_NOTIFY_API_SERVER
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user