Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: fix crash on showing announcement

Abdullah Attab8eab5bddc88
diff --git a/apps/web/src/stores/announcement-store.js b/apps/web/src/stores/announcement-store.js
index 25c07ae43..14cd23be6 100644
--- a/apps/web/src/stores/announcement-store.js
+++ b/apps/web/src/stores/announcement-store.js
@@ -97,7 +97,7 @@ async function shouldShowAnnouncement(announcement) {
if (!show) return false;
const user = await db.user.getUser();
- const subStatus = user.subscription?.type;
+ const subStatus = user?.subscription?.type;
show = announcement.userTypes.some((userType) => {
switch (userType) {
case "pro":