From 658946b02999b6b1c7ed6ebbe8c778daf5a6bd45 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 22 Nov 2025 15:35:47 +0100 Subject: [PATCH] fix: resolve readonly project type issue in AppHeader.vue Create mutable copy of currentProject from Pinia store to satisfy type requirements. The readonly deep object from the store has readonly tasks array which is incompatible with IProject type. Fixes TypeScript errors on lines 25 and 40 where readonly project was passed to getProjectTitle() and ProjectSettingsDropdown component. Related to issue #29 from TYPECHECK_ISSUES.md --- frontend/src/components/home/AppHeader.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/home/AppHeader.vue b/frontend/src/components/home/AppHeader.vue index 6790dfa57..9bcc2fc98 100644 --- a/frontend/src/components/home/AppHeader.vue +++ b/frontend/src/components/home/AppHeader.vue @@ -133,9 +133,14 @@ import { isEditorContentEmpty } from '@/helpers/editorContentEmpty' import { useBaseStore } from '@/stores/base' import { useConfigStore } from '@/stores/config' import { useAuthStore } from '@/stores/auth' +import type { IProject } from '@/modelTypes/IProject' const baseStore = useBaseStore() -const currentProject = computed(() => baseStore.currentProject) +// Create a mutable copy to satisfy type requirements (readonly deep -> mutable) +const currentProject = computed(() => { + const project = baseStore.currentProject + return project ? { ...project } as IProject : null +}) const background = computed(() => baseStore.background) const canWriteCurrentProject = computed(() => baseStore.currentProject?.maxPermission !== null && baseStore.currentProject?.maxPermission !== undefined && baseStore.currentProject.maxPermission > Permissions.READ) const menuActive = computed(() => baseStore.menuActive)