mirror of
https://github.com/zadam/trilium.git
synced 2025-10-30 18:05:55 +01:00
attachment improvements
This commit is contained in:
@@ -39,6 +39,8 @@ class NoteContext extends Component {
|
||||
|
||||
async setNote(inputNotePath, opts = {}) {
|
||||
opts.triggerSwitchEvent = opts.triggerSwitchEvent !== undefined ? opts.triggerSwitchEvent : true;
|
||||
opts.viewScope = opts.viewScope || {};
|
||||
opts.viewScope.viewMode = opts.viewScope.viewMode || "default";
|
||||
|
||||
const resolvedNotePath = await this.getResolvedNotePath(inputNotePath);
|
||||
|
||||
@@ -46,6 +48,10 @@ class NoteContext extends Component {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.notePath === resolvedNotePath && utils.areObjectsEqual(this.viewScope, opts.viewScope)) {
|
||||
return;
|
||||
}
|
||||
|
||||
await this.triggerEvent('beforeNoteSwitch', {noteContext: this});
|
||||
|
||||
utils.closeActiveDialog();
|
||||
@@ -53,8 +59,7 @@ class NoteContext extends Component {
|
||||
this.notePath = resolvedNotePath;
|
||||
({noteId: this.noteId, parentNoteId: this.parentNoteId} = treeService.getNoteIdAndParentIdFromNotePath(resolvedNotePath));
|
||||
|
||||
this.viewScope = opts.viewScope || {};
|
||||
this.viewScope.viewMode = this.viewScope.viewMode || "default";
|
||||
this.viewScope = opts.viewScope;
|
||||
|
||||
this.saveToRecentNotes(resolvedNotePath);
|
||||
|
||||
@@ -137,10 +142,6 @@ class NoteContext extends Component {
|
||||
return;
|
||||
}
|
||||
|
||||
if (resolvedNotePath === this.notePath) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (await hoistedNoteService.checkNoteAccess(resolvedNotePath, this) === false) {
|
||||
return; // note is outside of hoisted subtree and user chose not to unhoist
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user