Skip to content

Commit 6e6a230

Browse files
committed
feat(home): allow paste on projects
1 parent 2843a07 commit 6e6a230

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

app/keymap/clipboard.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,16 @@ const oncopy: ClipboardListener = (e, c, view) => {
7575
}
7676

7777
const onpaste: ClipboardListener = (e, c, view) => {
78-
if (!(c.task)) return;
78+
const parent = c.task?.treeid ?? c.project?.treeid;
79+
if (!parent) return;
80+
7981
if (c.task && c.task.isEditing) return;
82+
if (c.project && c.project.isEditing) return;
8083

8184
const target = e.clipboardData?.getData(key);
82-
8385
if (!target) return;
84-
if (target === c.task.treeid) return;
85-
e.preventDefault();
86+
if (target === parent) return;
8687

87-
const parent = c.task.treeid;
88+
e.preventDefault();
8889
view.state.copy({ id: target as TreeID }, { id: parent })
8990
}

0 commit comments

Comments
 (0)