mirror of
https://github.com/zadam/trilium.git
synced 2025-12-21 14:54:24 +01:00
refactor(breadcrumb): use existing function to parse note path
This commit is contained in:
parent
15f9b2cadf
commit
ec22fd9e99
@ -19,6 +19,7 @@ import froca from "../../services/froca";
|
|||||||
import hoisted_note from "../../services/hoisted_note";
|
import hoisted_note from "../../services/hoisted_note";
|
||||||
import { t } from "../../services/i18n";
|
import { t } from "../../services/i18n";
|
||||||
import note_create from "../../services/note_create";
|
import note_create from "../../services/note_create";
|
||||||
|
import tree from "../../services/tree";
|
||||||
import ActionButton from "../react/ActionButton";
|
import ActionButton from "../react/ActionButton";
|
||||||
import { Badge } from "../react/Badge";
|
import { Badge } from "../react/Badge";
|
||||||
import Dropdown from "../react/Dropdown";
|
import Dropdown from "../react/Dropdown";
|
||||||
@ -268,9 +269,7 @@ function buildContextMenu(notePath: string, parentComponent: Component | null) {
|
|||||||
return async (e: MouseEvent) => {
|
return async (e: MouseEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
const notePathComponents = notePath.split("/");
|
const { noteId, parentNoteId } = tree.getNoteIdAndParentIdFromUrl(notePath);
|
||||||
const parentNoteId = notePathComponents.at(-2);
|
|
||||||
const noteId = notePathComponents.at(-1);
|
|
||||||
if (!parentNoteId || !noteId) return;
|
if (!parentNoteId || !noteId) return;
|
||||||
|
|
||||||
const branchId = await froca.getBranchId(parentNoteId, noteId);
|
const branchId = await froca.getBranchId(parentNoteId, noteId);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user