Manage hidden photo count requests
This commit is contained in:
parent
d985ec03df
commit
8903672736
@ -49,11 +49,16 @@ export default function AppStateProvider({
|
||||
setUserEmail(data?.user?.email ?? undefined);
|
||||
logClientAuthUpdate(data);
|
||||
}, [data]);
|
||||
const isUserSignedIn = userEmail !== undefined;
|
||||
const isUserSignedIn = Boolean(userEmail);
|
||||
useEffect(() => {
|
||||
if (isUserSignedIn) {
|
||||
getPhotosTagHiddenMetaCachedAction().then(({ count }) =>
|
||||
setHiddenPhotosCount(count));
|
||||
const timeout = setTimeout(() =>
|
||||
getPhotosTagHiddenMetaCachedAction().then(({ count }) =>
|
||||
setHiddenPhotosCount(count))
|
||||
, 100);
|
||||
return () => clearTimeout(timeout);
|
||||
} else {
|
||||
setHiddenPhotosCount(0);
|
||||
}
|
||||
}, [isUserSignedIn]);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user