added post modal for feed on map

This commit is contained in:
SlimusMinus
2026-08-27 01:30:03 +03:00
parent 69e929efbf
commit 408a97e5b2
11 changed files with 512 additions and 27 deletions

View File

@@ -22,6 +22,11 @@ function clearTokens() {
let refreshPromise = null;
let onSessionExpired = null;
export function setOnSessionExpired(cb) {
onSessionExpired = cb;
}
export async function refreshAccessToken() {
if (refreshPromise) return refreshPromise;
@@ -73,6 +78,7 @@ export async function apiFetch(url, options = {}) {
res = await doFetch(newToken);
} catch {
clearTokens();
if (onSessionExpired) onSessionExpired();
throw new Error("Session expired");
}
}