mirror of
https://github.com/zadam/trilium.git
synced 2026-01-07 07:04:25 +01:00
fix(breadcrumb): hiding archived notes doesn't update tree
This commit is contained in:
parent
193c9d8fa6
commit
0390fd3174
@ -71,7 +71,7 @@ export default function Breadcrumb() {
|
|||||||
|
|
||||||
<div
|
<div
|
||||||
className="filler"
|
className="filler"
|
||||||
onContextMenu={buildEmptyAreaContextMenu()}
|
onContextMenu={buildEmptyAreaContextMenu(parentComponent)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@ -406,7 +406,7 @@ function buildContextMenu(notePath: string, parentComponent: Component | null) {
|
|||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
//#region Empty context menu
|
//#region Empty context menu
|
||||||
function buildEmptyAreaContextMenu() {
|
function buildEmptyAreaContextMenu(parentComponent: Component | null) {
|
||||||
return (e: MouseEvent) => {
|
return (e: MouseEvent) => {
|
||||||
const hideArchivedNotes = (options.get("hideArchivedNotes_main") === "true");
|
const hideArchivedNotes = (options.get("hideArchivedNotes_main") === "true");
|
||||||
|
|
||||||
@ -415,7 +415,12 @@ function buildEmptyAreaContextMenu() {
|
|||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
title: t("breadcrumb.empty_hide_archived_notes"),
|
title: t("breadcrumb.empty_hide_archived_notes"),
|
||||||
handler: () => options.save("hideArchivedNotes_main", !hideArchivedNotes ? "true" : "false"),
|
handler: async () => {
|
||||||
|
await options.save("hideArchivedNotes_main", !hideArchivedNotes ? "true" : "false");
|
||||||
|
|
||||||
|
// Note tree doesn't update by itself.
|
||||||
|
parentComponent?.triggerEvent("frocaReloaded", {});
|
||||||
|
},
|
||||||
checked: hideArchivedNotes
|
checked: hideArchivedNotes
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user