const BASE_URL = "https://tangled.org"; export const getNotificationsUrl = (): string => `${BASE_URL}/notifications`; export const getNotificationsUrlPattern = (): string => `${BASE_URL}/notifications*`; export const fetchNotificationCount = async (): Promise => { const response = await fetch(`${BASE_URL}/notifications/count`, { credentials: "include", }); // FIX: requires backend to return 401 when not logged in (currently returns 200 even if not logged in) if (!response.ok) throw new Error(`HTTP ${response.status}`); const html = await response.text(); const match = html.match(/>\s*(\d+\+?)\s*