Merge branch 'main' of https://github.com/sambecker/exif-photo-blog
This commit is contained in:
commit
a64240f3ad
@ -50,7 +50,7 @@ export default function PhotoMedium({
|
||||
prefetch={prefetch}
|
||||
>
|
||||
{({ isLoading }) =>
|
||||
<div>
|
||||
<div className="w-full h-full">
|
||||
{isLoading &&
|
||||
<div className={clsx(
|
||||
'absolute inset-0 flex items-center justify-center',
|
||||
|
||||
@ -58,10 +58,12 @@ export default function AppStateProvider({
|
||||
|
||||
const invalidateSwr = useCallback(() => setSwrTimestamp(Date.now()), []);
|
||||
|
||||
const { data } = useSWR('getAuth', getAuthAction);
|
||||
const { data, error } = useSWR('getAuth', getAuthAction);
|
||||
useEffect(() => {
|
||||
setUserEmail(data?.user?.email ?? undefined);
|
||||
}, [data]);
|
||||
if (!error) {
|
||||
setUserEmail(data?.user?.email ?? undefined);
|
||||
}
|
||||
}, [data, error]);
|
||||
const isUserSignedIn = Boolean(userEmail);
|
||||
useEffect(() => {
|
||||
if (isUserSignedIn) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user