fix(client): unable to trigger move to dialog via keyboard shortcut

This commit is contained in:
Elian Doran
2025-04-16 14:55:00 +03:00
parent b4c74af662
commit 2ad834fe5b
3 changed files with 19 additions and 2 deletions

View File

@@ -53,8 +53,8 @@ export interface ContextMenuCommandData extends CommandData {
node: Fancytree.FancytreeNode;
notePath?: string;
noteId?: string;
selectedOrActiveBranchIds?: any; // TODO: Remove any once type is defined
selectedOrActiveNoteIds: any; // TODO: Remove any once type is defined
selectedOrActiveBranchIds: string[];
selectedOrActiveNoteIds?: string[];
}
export interface NoteCommandData extends CommandData {

View File

@@ -18,10 +18,26 @@ export default class MainTreeExecutors extends Component {
}
async cloneNotesToCommand({ selectedOrActiveNoteIds }: EventData<"cloneNotesTo">) {
if (!selectedOrActiveNoteIds && this.tree) {
selectedOrActiveNoteIds = this.tree.getSelectedOrActiveNodes().map((node) => node.data.noteId);
}
if (!selectedOrActiveNoteIds) {
return;
}
this.triggerCommand("cloneNoteIdsTo", { noteIds: selectedOrActiveNoteIds });
}
async moveNotesToCommand({ selectedOrActiveBranchIds }: EventData<"moveNotesTo">) {
if (!selectedOrActiveBranchIds && this.tree) {
selectedOrActiveBranchIds = this.tree.getSelectedOrActiveNodes().map((node) => node.data.branchId);
}
if (!selectedOrActiveBranchIds) {
return;
}
this.triggerCommand("moveBranchIdsTo", { branchIds: selectedOrActiveBranchIds });
}