diff --git a/packages/client/src/components/tree/TaskTree.vue b/packages/client/src/components/tree/TaskTree.vue
index b025672..7eae646 100644
--- a/packages/client/src/components/tree/TaskTree.vue
+++ b/packages/client/src/components/tree/TaskTree.vue
@@ -1,12 +1,20 @@
@@ -55,6 +177,8 @@ const treeHeight = computed(() => {
:data="[filesystemTree]"
v-model:expanded-keys="expandKey"
v-model:selected-keys="selectedKeysFilter"
+ @drop="handleDrop"
+ draggable
block-line
selectable
expand-on-click
diff --git a/packages/client/src/data/task.ts b/packages/client/src/data/task.ts
index 2e38740..aef8ed5 100644
--- a/packages/client/src/data/task.ts
+++ b/packages/client/src/data/task.ts
@@ -68,17 +68,21 @@ export function setTask(p: PathKey | null, v: Task) {
export function delTask(p: PathKey | null) {
if (!p) {
- return
+ return null
}
const [, , hash] = path.divide(p)
if (!hash) {
- return
+ return null
}
const fd = fs.tree.openFile(p)
const obj = JSON.parse(fd.value) as TaskData
if (hash in obj) {
+ const task = obj[hash]
delete obj[hash]
fd.value = JSON.stringify(obj, null, 4)
+ return task
+ } else {
+ return null
}
}