From b9055c6810475cc91e78bf7ea61eea11205ff967 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 17 Sep 2025 22:57:09 +0300 Subject: [PATCH] fix(client): close button not working on first render --- apps/client/src/widgets/buttons/close_pane_button.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/client/src/widgets/buttons/close_pane_button.tsx b/apps/client/src/widgets/buttons/close_pane_button.tsx index 17990ad71..c171d0d8e 100644 --- a/apps/client/src/widgets/buttons/close_pane_button.tsx +++ b/apps/client/src/widgets/buttons/close_pane_button.tsx @@ -1,10 +1,10 @@ -import { useState } from "preact/hooks"; +import { useEffect, useState } from "preact/hooks"; import { t } from "../../services/i18n"; import ActionButton from "../react/ActionButton"; import { useNoteContext, useTriliumEvent } from "../react/hooks"; export default function ClosePaneButton() { - const { noteContext, parentComponent } = useNoteContext(); + const { noteContext, ntxId, parentComponent } = useNoteContext(); const [ isEnabled, setIsEnabled ] = useState(false); function refresh() { @@ -12,6 +12,7 @@ export default function ClosePaneButton() { } useTriliumEvent("noteContextReorder", refresh); + useEffect(refresh, [ ntxId ]); return (