assign default values

This commit is contained in:
isUnknown 2025-10-08 14:53:09 +02:00
parent f9796be7f2
commit 4054c54e57
2 changed files with 9 additions and 7 deletions

View file

@ -127,9 +127,9 @@ const { page } = storeToRefs(usePageStore());
const unreadNotificationsCount = computed(() => {
if (!user.value) return undefined;
const count = notifications.value.filter(
(notification) => !notification.isRead
).length;
const count =
notifications.value.filter((notification) => !notification.isRead).length ||
0;
if (count === 0) return undefined;
return count;
});
@ -320,7 +320,7 @@ button[aria-controls='menu'][aria-expanded='false']
align-items: center;
width: 100%;
min-height: 2.5rem; /* 40px */
padding: .66rem var(--space-16);
padding: 0.66rem var(--space-16);
gap: var(--space-12);
border-radius: var(--rounded-lg);
}

View file

@ -7,9 +7,11 @@ export const useProjectsStore = defineStore('projects', () => {
const projects = ref(null);
const currentProjects = computed(() => {
return projects.value
return (
projects.value
.filter((project) => project.status === 'listed')
.sort((a, b) => new Date(b.modified) - new Date(a.modified));
.sort((a, b) => new Date(b.modified) - new Date(a.modified)) || []
);
});
const draftProjects = computed(() => {