Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: hide tags input in new session

Abdullah Attad5a27b052cce
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 ? (
<Autosuggest
sessionId={id}
filter={(query) => db.lookup.tags(query).items(10)}