Update app/admin/page.tsx
This commit is contained in:
@@ -315,6 +315,13 @@ export default function AdminPage() {
|
||||
setUser(parsedUser)
|
||||
}, [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(() => {
|
||||
if (globalResetCooldown > 0) {
|
||||
const timer = setTimeout(() => setGlobalResetCooldown(globalResetCooldown - 1), 1000)
|
||||
|
||||
Reference in New Issue
Block a user