Skip to content

Connect, collaborate, and grow with a community of TypeScript developers

perf: only query notification count if logged in (#1585)

Sean Boultd675cab67db4
diff --git a/apps/web/src/components/Navigation/index.tsx b/apps/web/src/components/Navigation/index.tsx
index 3ec46ee7..6b87dc32 100644
--- a/apps/web/src/components/Navigation/index.tsx
+++ b/apps/web/src/components/Navigation/index.tsx
@@ -36,11 +36,10 @@ export function getAdminUrl() {
}
export async function Navigation() {
- const [session, featureFlags, notificationCount] = await Promise.all([
- auth(),
- getAllFlags(),
- getNotificationCount(),
- ]);
+ const [session, featureFlags] = await Promise.all([auth(), getAllFlags()]);
+
+ const notificationCount = session ? await getNotificationCount() : 0;
+
const isAdminOrMod = isAdminOrModerator(session);
const isAdminRole = isAdmin(session);
diff --git a/docker-compose.yaml b/docker-compose.yaml
index 3000250f..d0c59c58 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -1,5 +1,4 @@
# create a docker image with mysql and a default password of admin
-version: '3'
name: typehero