feat(navigation): make dragging a project under another project work

This commit is contained in:
kolaente 2023-03-27 13:25:23 +02:00
parent fa71cec5c8
commit ab94343d07
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@
<span class="list-setting-spacer" v-else></span>
</section>
<ProjectsNavigation
v-if="p.childProjects.length > 0 && !collapsedProjects[p.id]"
v-if="!collapsedProjects[p.id]"
v-model="p.childProjects"
/>
</li>
@ -151,7 +151,7 @@ async function saveProjectPosition(e: SortableEvent) {
projectAfter !== null ? projectAfter.position : null,
)
if (project.parentProjectId !== parentProjectId) {
if (project.parentProjectId !== parentProjectId && project.parentProjectId > 0) {
const parentProject = projectStore.getProjectById(project.parentProjectId)
const childProjectIndex = parentProject.childProjects.findIndex(p => p.id === project.id)
parentProject.childProjects.splice(childProjectIndex, 1)