Skip to content

Commit

Permalink
return null instead of Skeleton while root collection is loading
Browse files Browse the repository at this point in the history
  • Loading branch information
ekraffmiller committed Nov 1, 2024
1 parent 44b2569 commit adbe883
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/sections/layout/header/LoggedInHeaderActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { User } from '../../../users/domain/models/User'
import { CollectionRepository } from '../../../collection/domain/repositories/CollectionRepository'
import { AccountHelper } from '../../account/AccountHelper'
import { useCollection } from '@/sections/collection/useCollection'
import Skeleton from 'react-loading-skeleton'
import { PageNotFound } from '@/sections/page-not-found/PageNotFound'

const currentPage = 0

Expand Down Expand Up @@ -36,11 +36,12 @@ export const LoggedInHeaderActions = ({
navigate(currentPage)
})
}
if (isLoading) {
return <Skeleton />

if (!isLoading && !collection) {
return <PageNotFound />
}

if (!collection) {
if (isLoading || !collection) {
return null
}

Expand Down

0 comments on commit adbe883

Please sign in to comment.