mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-26 01:58:21 +03:00
prevent unnecessary reloads in useUserPersistence hook
This commit is contained in:
parent
c2e667c0dd
commit
22056c3fc1
@ -116,6 +116,11 @@ export function useUserPersistence<S>(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip reload if we're already loaded for this key
|
||||||
|
if (loadedKeyRef.current === namespacedKey) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Reset state when key changes - this prevents stale writes
|
// Reset state when key changes - this prevents stale writes
|
||||||
loadedKeyRef.current = null;
|
loadedKeyRef.current = null;
|
||||||
migrationAttemptedRef.current = false;
|
migrationAttemptedRef.current = false;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user