From d498a7a2b9ec63b06dfd779aad31347b2436e70e Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Thu, 14 Mar 2024 12:29:18 +0500 Subject: [PATCH] web: hide tags input in new session --- apps/web/src/components/editor/header.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/web/src/components/editor/header.tsx b/apps/web/src/components/editor/header.tsx index 5bae59888..aecb999ad 100644 --- a/apps/web/src/components/editor/header.tsx +++ b/apps/web/src/components/editor/header.tsx @@ -34,9 +34,10 @@ import { Tag } from "@notesnook/core"; type HeaderProps = { readonly: boolean; id: string }; function Header(props: HeaderProps) { const { readonly, id } = props; - const tags = useEditorStore( - (store) => store.getSession(id, ["default", "readonly"])?.tags || [] + const session = useEditorStore((store) => + store.getActiveSession(["default", "readonly"]) ); + const tags = session?.tags || []; const refreshTags = useEditorStore((store) => store.refreshTags); useEffect(() => { @@ -79,7 +80,7 @@ function Header(props: HeaderProps) { styles={{ container: { mr: 1 }, text: { fontSize: "body" } }} /> ))} - {!readonly && tags ? ( + {!!session && !readonly && tags ? ( db.lookup.tags(query).items(10)}