Aggressively invalidate when logged in
This commit is contained in:
parent
1ea7f2f9ac
commit
c96e0f58a5
@ -31,7 +31,7 @@ export default function InfinitePhotoScroll({
|
||||
triggerOnView?: boolean
|
||||
debug?: boolean
|
||||
}) {
|
||||
const { swrTimestamp } = useAppState();
|
||||
const { swrTimestamp, isUserSignedIn } = useAppState();
|
||||
|
||||
const key = `${swrTimestamp}-${type}`;
|
||||
|
||||
@ -52,7 +52,12 @@ export default function InfinitePhotoScroll({
|
||||
useSwrInfinite<Photo[]>(
|
||||
keyGenerator,
|
||||
fetcher,
|
||||
{ revalidateFirstPage: false },
|
||||
{
|
||||
revalidateFirstPage: Boolean(isUserSignedIn),
|
||||
revalidateOnMount: Boolean(isUserSignedIn),
|
||||
revalidateOnFocus: Boolean(isUserSignedIn),
|
||||
revalidateOnReconnect: Boolean(isUserSignedIn),
|
||||
},
|
||||
);
|
||||
|
||||
const buttonContainerRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user