From bb21412b1671ae30d43da40a70064c16e0c2ad5c Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Tue, 8 Apr 2025 14:37:12 +0500 Subject: [PATCH] web: fix note counts not updating in tags list --- apps/web/src/components/tag/index.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/web/src/components/tag/index.tsx b/apps/web/src/components/tag/index.tsx index 2e8612981..769b7c37a 100644 --- a/apps/web/src/components/tag/index.tsx +++ b/apps/web/src/components/tag/index.tsx @@ -36,9 +36,12 @@ type TagProps = { item: TagType; totalNotes: number }; function Tag(props: TagProps) { const { item, totalNotes } = props; const { id } = item; - const isSelected = useNoteStore( - (store) => store.context?.type === "tag" && store.context.id === id + const currentContext = useNoteStore((store) => + store.context?.type === "tag" && store.context.id === id + ? store.contextNotes + : null ); + const isSelected = !!currentContext; return ( - {totalNotes} + {currentContext?.length || totalNotes} } onKeyPress={async (e) => {