detect existing attachment in target note

This commit is contained in:
zadam
2023-05-29 22:37:19 +02:00
parent df17840dbc
commit 235b779dec
22 changed files with 80 additions and 52 deletions

View File

@@ -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);

View File

@@ -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});
}

View File

@@ -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;