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

View file

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