Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 2ad834f

Browse files
committed
fix(client): unable to trigger move to dialog via keyboard shortcut
1 parent b4c74af commit 2ad834f

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

docs/Release Notes/Release Notes/v0.93.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* [Return correct HTTP status code on failed login attempts instead of 200](https://github.com/TriliumNext/Notes/issues/1707) by @pano9000
1717
* [Calendar stops displaying notes after adding a Day Note](https://github.com/TriliumNext/Notes/issues/1705)
1818
* Full anonymization not redacting attachment titles.
19+
* Unable to trigger "Move to" dialog via keyboard shortcut.
1920

2021
## ✨ Improvements
2122

src/public/app/components/app_context.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ export interface ContextMenuCommandData extends CommandData {
5353
node: Fancytree.FancytreeNode;
5454
notePath?: string;
5555
noteId?: string;
56-
selectedOrActiveBranchIds?: any; // TODO: Remove any once type is defined
57-
selectedOrActiveNoteIds: any; // TODO: Remove any once type is defined
56+
selectedOrActiveBranchIds: string[];
57+
selectedOrActiveNoteIds?: string[];
5858
}
5959

6060
export interface NoteCommandData extends CommandData {

src/public/app/components/main_tree_executors.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,26 @@ export default class MainTreeExecutors extends Component {
1818
}
1919

2020
async cloneNotesToCommand({ selectedOrActiveNoteIds }: EventData<"cloneNotesTo">) {
21+
if (!selectedOrActiveNoteIds && this.tree) {
22+
selectedOrActiveNoteIds = this.tree.getSelectedOrActiveNodes().map((node) => node.data.noteId);
23+
}
24+
25+
if (!selectedOrActiveNoteIds) {
26+
return;
27+
}
28+
2129
this.triggerCommand("cloneNoteIdsTo", { noteIds: selectedOrActiveNoteIds });
2230
}
2331

2432
async moveNotesToCommand({ selectedOrActiveBranchIds }: EventData<"moveNotesTo">) {
33+
if (!selectedOrActiveBranchIds && this.tree) {
34+
selectedOrActiveBranchIds = this.tree.getSelectedOrActiveNodes().map((node) => node.data.branchId);
35+
}
36+
37+
if (!selectedOrActiveBranchIds) {
38+
return;
39+
}
40+
2541
this.triggerCommand("moveBranchIdsTo", { branchIds: selectedOrActiveBranchIds });
2642
}
2743

0 commit comments

Comments
 (0)