mirror of
https://github.com/zadam/trilium.git
synced 2025-12-16 20:34:25 +01:00
chore(formatting_toolbar): address self-review
This commit is contained in:
parent
8d536a6040
commit
ad08fb8132
@ -65,25 +65,21 @@ class NoteContext extends Component implements EventListener<"entitiesReloaded">
|
|||||||
}
|
}
|
||||||
|
|
||||||
async setNote(inputNotePath: string | undefined, opts: SetNoteOpts = {}) {
|
async setNote(inputNotePath: string | undefined, opts: SetNoteOpts = {}) {
|
||||||
console.log("Set note to ", inputNotePath);
|
|
||||||
opts.triggerSwitchEvent = opts.triggerSwitchEvent !== undefined ? opts.triggerSwitchEvent : true;
|
opts.triggerSwitchEvent = opts.triggerSwitchEvent !== undefined ? opts.triggerSwitchEvent : true;
|
||||||
opts.viewScope = opts.viewScope || {};
|
opts.viewScope = opts.viewScope || {};
|
||||||
opts.viewScope.viewMode = opts.viewScope.viewMode || "default";
|
opts.viewScope.viewMode = opts.viewScope.viewMode || "default";
|
||||||
|
|
||||||
if (!inputNotePath) {
|
if (!inputNotePath) {
|
||||||
console.log("EXIT A");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const resolvedNotePath = await this.getResolvedNotePath(inputNotePath);
|
const resolvedNotePath = await this.getResolvedNotePath(inputNotePath);
|
||||||
|
|
||||||
if (!resolvedNotePath) {
|
if (!resolvedNotePath) {
|
||||||
console.log("EXIT B");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.notePath === resolvedNotePath && utils.areObjectsEqual(this.viewScope, opts.viewScope)) {
|
if (this.notePath === resolvedNotePath && utils.areObjectsEqual(this.viewScope, opts.viewScope)) {
|
||||||
console.log("EXIT C");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,7 +90,6 @@ class NoteContext extends Component implements EventListener<"entitiesReloaded">
|
|||||||
this.notePath = resolvedNotePath;
|
this.notePath = resolvedNotePath;
|
||||||
this.viewScope = opts.viewScope;
|
this.viewScope = opts.viewScope;
|
||||||
({ noteId: this.noteId, parentNoteId: this.parentNoteId } = treeService.getNoteIdAndParentIdFromUrl(resolvedNotePath));
|
({ noteId: this.noteId, parentNoteId: this.parentNoteId } = treeService.getNoteIdAndParentIdFromUrl(resolvedNotePath));
|
||||||
console.log("Note ID set to ", this.noteId);
|
|
||||||
|
|
||||||
this.saveToRecentNotes(resolvedNotePath);
|
this.saveToRecentNotes(resolvedNotePath);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user