Redesign Phases 3-6: multi-event model, APPE Admin, Convivo App behaviors, APPE branding
- Phase 3: new migration 20260824000000_redesign.sql (contacts/events/registrations/sponsors, slot types, session speakers + feedback/material), seed rewrite - Phase 4: APPE Admin rebrand + Contacts/Registrations/Sponsors/Schedule/Activity/Events views - Phase 5: Convivo App (24h login, 5s polling, QR type badge, red dot, speaker material) - Phase 6: APPE favicon + PWA icons for both apps - Docs: schema/rpcs/rls/seed/screens/api-client/admin-app/architecture/next-steps/README/roadmap updated Co-authored-by: Stephan Charles <[email protected]> Co-authored-by: Amelia Hernandez <[email protected]> Co-authored-by: Markus Franz <[email protected]> Co-authored-by: Sabrina Hota <[email protected]> Co-authored-by: Nilüfer Doğan <[email protected]>
This commit is contained in:
1 parent
2f53d47578
commit
7605c9bbf4
64 files changed
+4593
-1371
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import { useEffect, useRef } from 'react';
|
||||
|
||||
/**
|
||||
* Runs `fn` every `ms` milliseconds, but ONLY while the tab is visible
|
||||
* (document.visibilityState === 'visible'). Also re-runs immediately when the
|
||||
* tab becomes visible again. No background polling.
|
||||
*/
|
||||
export function usePolling(fn: () => void, ms: number, enabled = true): void {
|
||||
const saved = useRef(fn);
|
||||
saved.current = fn;
|
||||
|
||||
useEffect(() => {
|
||||
if (!enabled) return;
|
||||
let timer: number | undefined;
|
||||
|
||||
const tick = () => {
|
||||
if (document.visibilityState === 'visible') saved.current();
|
||||
};
|
||||
|
||||
timer = window.setInterval(tick, ms);
|
||||
const onVis = () => {
|
||||
if (document.visibilityState === 'visible') tick();
|
||||
};
|
||||
document.addEventListener('visibilitychange', onVis);
|
||||
|
||||
return () => {
|
||||
if (timer !== undefined) window.clearInterval(timer);
|
||||
document.removeEventListener('visibilitychange', onVis);
|
||||
};
|
||||
}, [ms, enabled]);
|
||||
}
|
||||
Reference in new issue
Block a user