mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 19:12:27 +08:00
fix(client): unable to trigger move to dialog via keyboard shortcut
This commit is contained in:
parent
b4c74af662
commit
2ad834fe5b
@ -16,6 +16,7 @@
|
|||||||
* [Return correct HTTP status code on failed login attempts instead of 200](https://github.com/TriliumNext/Notes/issues/1707) by @pano9000
|
* [Return correct HTTP status code on failed login attempts instead of 200](https://github.com/TriliumNext/Notes/issues/1707) by @pano9000
|
||||||
* [Calendar stops displaying notes after adding a Day Note](https://github.com/TriliumNext/Notes/issues/1705)
|
* [Calendar stops displaying notes after adding a Day Note](https://github.com/TriliumNext/Notes/issues/1705)
|
||||||
* Full anonymization not redacting attachment titles.
|
* Full anonymization not redacting attachment titles.
|
||||||
|
* Unable to trigger "Move to" dialog via keyboard shortcut.
|
||||||
|
|
||||||
## ✨ Improvements
|
## ✨ Improvements
|
||||||
|
|
||||||
|
@ -53,8 +53,8 @@ export interface ContextMenuCommandData extends CommandData {
|
|||||||
node: Fancytree.FancytreeNode;
|
node: Fancytree.FancytreeNode;
|
||||||
notePath?: string;
|
notePath?: string;
|
||||||
noteId?: string;
|
noteId?: string;
|
||||||
selectedOrActiveBranchIds?: any; // TODO: Remove any once type is defined
|
selectedOrActiveBranchIds: string[];
|
||||||
selectedOrActiveNoteIds: any; // TODO: Remove any once type is defined
|
selectedOrActiveNoteIds?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface NoteCommandData extends CommandData {
|
export interface NoteCommandData extends CommandData {
|
||||||
|
@ -18,10 +18,26 @@ export default class MainTreeExecutors extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async cloneNotesToCommand({ selectedOrActiveNoteIds }: EventData<"cloneNotesTo">) {
|
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 });
|
this.triggerCommand("cloneNoteIdsTo", { noteIds: selectedOrActiveNoteIds });
|
||||||
}
|
}
|
||||||
|
|
||||||
async moveNotesToCommand({ selectedOrActiveBranchIds }: EventData<"moveNotesTo">) {
|
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 });
|
this.triggerCommand("moveBranchIdsTo", { branchIds: selectedOrActiveBranchIds });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user