mirror of
https://github.com/zadam/trilium.git
synced 2025-11-26 02:24:23 +01:00
refactor(popup_editor): use simpler mechanism for retrieving note ID
This commit is contained in:
parent
24361ccd97
commit
7ecdee7a89
@ -30,10 +30,8 @@ export default function PopupEditor() {
|
|||||||
|
|
||||||
useTriliumEvent("openInPopup", async ({ noteIdOrPath }) => {
|
useTriliumEvent("openInPopup", async ({ noteIdOrPath }) => {
|
||||||
const noteContext = new NoteContext("_popup-editor");
|
const noteContext = new NoteContext("_popup-editor");
|
||||||
const resolvedNotePath = await tree.resolveNotePath(noteIdOrPath, noteContext.hoistedNoteId);
|
|
||||||
if (!resolvedNotePath) return;
|
|
||||||
|
|
||||||
const noteId = tree.getNoteIdAndParentIdFromUrl(resolvedNotePath);
|
const noteId = tree.getNoteIdAndParentIdFromUrl(noteIdOrPath);
|
||||||
if (!noteId.noteId) return;
|
if (!noteId.noteId) return;
|
||||||
const note = await froca.getNote(noteId.noteId);
|
const note = await froca.getNote(noteId.noteId);
|
||||||
if (!note) return;
|
if (!note) return;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user