From 3bbb50123a269cc7179205c3ecc76738f9b9cf79 Mon Sep 17 00:00:00 2001 From: isark Date: Sun, 24 Mar 2024 13:15:14 +0100 Subject: [PATCH] Editor bugfix missed cleanup before importing. Bugfix drag&drop at last position without doubleclick/drop-box --- src-tauri/tauri.conf.json | 2 +- src/app/editor/editor.component.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 2a8da0e..79e99a5 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -8,7 +8,7 @@ }, "package": { "productName": "Nothing", - "version": "1.8.5" + "version": "1.8.6" }, "tauri": { "systemTray": { diff --git a/src/app/editor/editor.component.ts b/src/app/editor/editor.component.ts index 7f1b83c..81264d2 100644 --- a/src/app/editor/editor.component.ts +++ b/src/app/editor/editor.component.ts @@ -135,7 +135,7 @@ export class EditorComponent implements OnInit { } const bounds = this.planElemFilterBounds(); - let index = event.item.data; + let index = event.currentIndex; if (bounds) { index += bounds[0]; } @@ -318,6 +318,9 @@ export class EditorComponent implements OnInit { if (file) { // We disallow multiple but interface still says it can be multiple, thus the cast. this.planService.loadPlanFromPath(file as string, false).subscribe(plan => { + while (this.original.length > 0) { + this.original.pop(); + } plan.plan.forEach(item => this.original.push(item)); this.filterPlanElements(); }); @@ -327,6 +330,9 @@ export class EditorComponent implements OnInit { loadBasePlan() { this.planService.getBasePlan().subscribe(plan => { + while (this.original.length > 0) { + this.original.pop(); + } plan.plan.forEach(item => this.original.push(item)); this.filterPlanElements(); })