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) => {