Update app/admin/page.tsx
This commit is contained in:
@@ -315,6 +315,13 @@ export default function AdminPage() {
|
|||||||
setUser(parsedUser)
|
setUser(parsedUser)
|
||||||
}, [router])
|
}, [router])
|
||||||
|
|
||||||
|
// Add this right after the existing useEffect that sets the user
|
||||||
|
useEffect(() => {
|
||||||
|
// Force initial fetch when user changes
|
||||||
|
if (user?.national_id) {
|
||||||
|
refetchGlobal()
|
||||||
|
}
|
||||||
|
}, [user?.national_id, refetchGlobal])
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (globalResetCooldown > 0) {
|
if (globalResetCooldown > 0) {
|
||||||
const timer = setTimeout(() => setGlobalResetCooldown(globalResetCooldown - 1), 1000)
|
const timer = setTimeout(() => setGlobalResetCooldown(globalResetCooldown - 1), 1000)
|
||||||
|
|||||||
Reference in New Issue
Block a user