perf: memo GridCard, fuse save fns, fix slash tab active color
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
CONSENT_CHANGE_EVENT,
|
||||
getConsent,
|
||||
hasConsentChoice,
|
||||
loadConsentWithDBSync,
|
||||
type ConsentRecord,
|
||||
} from '@/lib/consent/cookie-consent'
|
||||
|
||||
@@ -12,8 +13,10 @@ export function useCookieConsent() {
|
||||
const [consent, setConsentState] = useState<ConsentRecord | null>(null)
|
||||
const [ready, setReady] = useState(false)
|
||||
|
||||
const refresh = useCallback(() => {
|
||||
setConsentState(getConsent())
|
||||
const refresh = useCallback(async () => {
|
||||
// Try local first, then DB sync for authenticated users
|
||||
const loaded = await loadConsentWithDBSync()
|
||||
setConsentState(loaded)
|
||||
setReady(true)
|
||||
}, [])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user