mirror of
https://github.com/zadam/trilium.git
synced 2025-11-14 17:25:52 +01:00
detect existing attachment in target note
This commit is contained in:
@@ -62,7 +62,7 @@ class NoteContext extends Component {
|
||||
|
||||
this.notePath = resolvedNotePath;
|
||||
this.viewScope = opts.viewScope;
|
||||
({noteId: this.noteId, parentNoteId: this.parentNoteId} = treeService.getNoteIdAndParentIdFromNotePath(resolvedNotePath));
|
||||
({noteId: this.noteId, parentNoteId: this.parentNoteId} = treeService.getNoteIdAndParentIdFromUrl(resolvedNotePath));
|
||||
|
||||
this.saveToRecentNotes(resolvedNotePath);
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ export default class RootCommandExecutor extends Component {
|
||||
}
|
||||
|
||||
async searchInSubtreeCommand({notePath}) {
|
||||
const noteId = treeService.getNoteIdFromNotePath(notePath);
|
||||
const noteId = treeService.getNoteIdFromUrl(notePath);
|
||||
|
||||
this.searchNotesCommand({ancestorNoteId: noteId});
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ export default class TabManager extends Component {
|
||||
// preload all notes at once
|
||||
await froca.getNotes([
|
||||
...noteContextsToOpen.flatMap(tab =>
|
||||
[ treeService.getNoteIdFromNotePath(tab.notePath), tab.hoistedNoteId]
|
||||
[ treeService.getNoteIdFromUrl(tab.notePath), tab.hoistedNoteId]
|
||||
),
|
||||
], true);
|
||||
|
||||
@@ -66,7 +66,7 @@ export default class TabManager extends Component {
|
||||
return !!openTab.active;
|
||||
}
|
||||
|
||||
const noteId = treeService.getNoteIdFromNotePath(openTab.notePath);
|
||||
const noteId = treeService.getNoteIdFromUrl(openTab.notePath);
|
||||
if (!(noteId in froca.notes)) {
|
||||
// note doesn't exist so don't try to open tab for it
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user