WIP: new-activity notification #231

Draft
trentlarson wants to merge 80 commits from notify-api into master
Showing only changes of commit 4152012838 - Show all commits

View File

@@ -3,7 +3,7 @@
* 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 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 {
const raw = readStorage(STORAGE_KEY_BACKEND_URL);
if (raw === null) {
@@ -101,12 +101,15 @@ export function setBypassAuth(enabled: boolean): void {
/**
* 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 {
const override = getBackendBaseUrl();
if (override) {
return override;
}
return normalizeNotificationBackendUrl(APP_SERVER) ?? APP_SERVER;
return (
normalizeNotificationBackendUrl(DEFAULT_NOTIFY_API_SERVER) ??
DEFAULT_NOTIFY_API_SERVER
);
}