WIP 2.0.0: React Compiler lint rules back to errors; docs
- The 192 places the rules flagged are fixed and the rules are errors again (npx eslint src: nothing). lib/hooks.ts: useStateSync (state that follows other state, set while rendering), useExternalEffect (API loads and browser reads), useNow; lib/navigation.ts hardNavigate for full reloads after sign-out or identity switches; other pages use the router. Resets moved into the handlers that cause them. - The banner shows and hides at its times on open pages. - HANDOVER, roadmap, README, FEATURES, SETTINGS, CHANGELOG updated; 2.0.0 section drafted in WHATS-NEW. e2e 102/102 (PayFast sandbox skipped); production build passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
* browser sends.
|
||||
*/
|
||||
import { API_BASE } from "@/lib/api";
|
||||
import { hardNavigate } from "@/lib/navigation";
|
||||
|
||||
const TOKEN_KEY = "hope_events_token";
|
||||
const USER_CACHE_KEY = "hope_events_user_cache";
|
||||
@@ -38,7 +39,7 @@ export function beginImpersonation(res: ImpersonationStart) {
|
||||
localStorage.removeItem(USER_CACHE_KEY);
|
||||
localStorage.setItem(IMP_KEY, JSON.stringify({ sessionId: res.session.id, expiresAt: res.session.expiresAt, name: res.session.target.name, email: res.session.target.email }));
|
||||
} catch { /* storage unavailable */ }
|
||||
window.location.href = "/dashboard/user";
|
||||
hardNavigate("/dashboard/user");
|
||||
}
|
||||
|
||||
/** Puts the admin's own session back (no server call). */
|
||||
@@ -52,7 +53,7 @@ export function restoreAdmin(redirect = true) {
|
||||
localStorage.removeItem(ADMIN_CACHE_KEY);
|
||||
localStorage.removeItem(IMP_KEY);
|
||||
} catch { /* storage unavailable */ }
|
||||
if (redirect) window.location.href = "/dashboard/admin/users";
|
||||
if (redirect) hardNavigate("/dashboard/admin/users");
|
||||
}
|
||||
|
||||
/** Ends the session on the server (audited), then restores the admin. */
|
||||
|
||||
Reference in New Issue
Block a user