Skip to content

Commit

Permalink
handle logged-out state
Browse files Browse the repository at this point in the history
  • Loading branch information
nl0 committed Sep 5, 2022
1 parent 5f5b19d commit 9b6cc93
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions catalog/app/utils/StatusReportsBucket.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import invariant from 'invariant'

import useQuery from 'utils/useQuery'

import STATUS_REPORTS_BUCKET_QUERY from './StatusReportsBucket.generated'
Expand All @@ -9,7 +7,7 @@ export function useStatusReportsBucket() {
query: STATUS_REPORTS_BUCKET_QUERY,
suspend: true,
})
invariant(result.data, 'No data')
if (!result.data) return null
const { status } = result.data
return status.__typename === 'Status' ? status.reportsBucket : null
}

0 comments on commit 9b6cc93

Please sign in to comment.