Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Merge branch 'master' into hf/fix-nullable-issues

Joshen Lim01d85bcdacdc
diff --cc studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/index.tsx
index 92d8ac76d10,ebc0348ea3f..d11b4f510a2
--- a/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/index.tsx
+++ b/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/index.tsx
@@@ -33,11 -37,12 +37,12 @@@ const NotificationsPopover = ({ alt = f
const [targetNotification, setTargetNotification] = useState<Notification>()
- if (!notifications || !Array.isArray(notifications)) return <></>
- if (!notifications) return <></>
++ if (!notifications || !Array.isArray(notifications)) return null
- const hasNewNotifications = notifications.some(
+ const newNotifications = notifications?.filter(
(notification) => notification.notification_status === NotificationStatus.New
)
+ const hasNewNotifications = newNotifications.length > 0
const onOpenChange = async (open: boolean) => {
// TODO(alaister): move this to a mutation
diff --cc studio/data/organizations/organizations-query.ts
index 4e3b207811f,dab843414ad..4bf70566dd8
--- a/studio/data/organizations/organizations-query.ts
+++ b/studio/data/organizations/organizations-query.ts
@@@ -9,12 -9,7 +9,11 @@@ export async function getOrganizations(
const data = await get(`${API_URL}/organizations`, { signal })
if (data.error) throw data.error
+ if (!Array.isArray(data)) {
+ return []
+ }
+
const sorted = (data as Organization[]).sort((a, b) => a.name.localeCompare(b.name))
-
return sorted
}