diff --git a/studio/hooks/misc/useNotifications.tsx b/studio/hooks/misc/useNotifications.tsx index f0e817306c3..974bc388f9f 100644 --- a/studio/hooks/misc/useNotifications.tsx +++ b/studio/hooks/misc/useNotifications.tsx @@ -6,11 +6,12 @@ import { API_URL } from 'lib/constants' export const useNotifications = () => { const { data, error, mutate } = useSWR(`${API_URL}/notifications`, get) - const anyError = error !== undefined + + const anyError = (data as any)?.error || error !== undefined const refresh = () => mutate() return { - notifications: anyError ? undefined : data, + notifications: anyError ? [] : data, isLoading: !anyError && !data, isError: !!anyError, refresh,