From f67af5520469c3b2cd639687b0b19b29a7d3d43e Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 22 Nov 2025 15:35:37 +0100 Subject: [PATCH] fix: resolve readonly array type issue in Navigation.vue Cast readonly project arrays from Pinia store to mutable IProject[] type. The arrays are not actually mutated by the component, so the cast is safe. Fixes TypeScript errors on lines 86, 97, 105 where readonly arrays were incompatible with ProjectsNavigation component props. Related to issue #28 from TYPECHECK_ISSUES.md --- frontend/src/components/home/Navigation.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/home/Navigation.vue b/frontend/src/components/home/Navigation.vue index 6dd4f3142..d36a014af 100644 --- a/frontend/src/components/home/Navigation.vue +++ b/frontend/src/components/home/Navigation.vue @@ -126,13 +126,15 @@ import Loading from '@/components/misc/Loading.vue' import {useBaseStore} from '@/stores/base' import {useProjectStore} from '@/stores/projects' import ProjectsNavigation from '@/components/home/ProjectsNavigation.vue' +import type {IProject} from '@/modelTypes/IProject' const baseStore = useBaseStore() const projectStore = useProjectStore() -const projects = computed(() => projectStore.notArchivedRootProjects) -const favoriteProjects = computed(() => projectStore.favoriteProjects) -const savedFilterProjects = computed(() => projectStore.savedFilterProjects) +// Cast readonly arrays to mutable type - the arrays are not actually mutated by the component +const projects = computed(() => projectStore.notArchivedRootProjects as IProject[]) +const favoriteProjects = computed(() => projectStore.favoriteProjects as IProject[]) +const savedFilterProjects = computed(() => projectStore.savedFilterProjects as IProject[])