Skip to content

Commit

Permalink
fix(home): constant refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
RaunoT committed Jan 8, 2024
1 parent e03614b commit b2e5b9d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export default function Page() {
if (res?.error) {
console.error('Failed to sign in:', res.error)
}

setIsLoading(false)
} catch (error) {
console.error('Error during sign-in:', error)
Expand Down Expand Up @@ -77,7 +78,7 @@ export default function Page() {

try {
const res = await fetch(
`/api/managed-users?userId=${session.user.id}`,
`/api/managed-users?userId=${session?.user.id}`,
)
const data = await res.json()

Expand All @@ -94,7 +95,7 @@ export default function Page() {
} else if (status !== 'loading') {
setIsLoading(false)
}
}, [status, session])
}, [status, session?.user.id])

if (isLoading) {
return <Loader />
Expand Down

0 comments on commit b2e5b9d

Please sign in to comment.