mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 10:42:08 +00:00
Fix login glitch where user session wouldn't load properly into context
This commit is contained in:
@@ -10,7 +10,7 @@ const spaceGrotesk = Space_Grotesk({
|
||||
});
|
||||
|
||||
export default function App({ Component, pageProps }: AppProps) {
|
||||
const { user, isLoading, error } = useUser();
|
||||
const { user, isLoading, error, mutate } = useUser();
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -21,7 +21,7 @@ export default function App({ Component, pageProps }: AppProps) {
|
||||
}
|
||||
`}
|
||||
</style>
|
||||
<UserContext.Provider value={{ user, isLoading, error }}>
|
||||
<UserContext.Provider value={{ user, isLoading, error, mutate }}>
|
||||
<Component {...pageProps} />
|
||||
</UserContext.Provider>
|
||||
</>
|
||||
|
||||
@@ -11,9 +11,9 @@ const ProtectedPage: NextPage = () => {
|
||||
|
||||
const currentTime = new Date().getHours();
|
||||
|
||||
const isMorning = currentTime > 5 && currentTime < 12;
|
||||
const isMorning = currentTime > 4 && currentTime < 12;
|
||||
const isAfternoon = currentTime > 12 && currentTime < 18;
|
||||
const isEvening = currentTime > 18 && currentTime < 24;
|
||||
const isEvening = currentTime > 18 && currentTime < 24 || currentTime <4
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
|
||||
Reference in New Issue
Block a user