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
This commit is contained in:
kolaente 2025-11-22 15:35:37 +01:00
parent 4cd53c204d
commit f67af55204
1 changed files with 5 additions and 3 deletions

View File

@ -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[])
</script>
<style lang="scss" scoped>