Skip to content

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

mobile: fix add tag button not show when no tags

Ammar Ahmedb7d2d66e8287
diff --git a/packages/editor-mobile/src/components/tags.tsx b/packages/editor-mobile/src/components/tags.tsx
index 7630a0af8..3ccd2add5 100644
--- a/packages/editor-mobile/src/components/tags.tsx
+++ b/packages/editor-mobile/src/components/tags.tsx
@@ -23,7 +23,7 @@ import { useTabContext } from "../hooks/useTabStore";
import { Settings } from "../utils";
import { EditorEvents } from "../utils/editor-events";
import styles from "./styles.module.css";
-function Tags(props: { settings: Settings; loading?: boolean }): JSX.Element {
+function Tags(props: { settings: Settings; loading?: boolean }) {
const [tags, setTags] = useState<
{ title: string; alias: string; id: string; type: "tag" }[]
>([]);
@@ -49,14 +49,12 @@ function Tags(props: { settings: Settings; loading?: boolean }): JSX.Element {
};
const fontScale = props.settings?.fontScale || 1;
- return (
+ return !tab.session?.noteId ? null : (
<div
className={styles.container}
style={{
- display: tags.length === 0 ? "none" : "flex",
- position: tags.length === 0 ? "absolute" : "relative",
+ display: "flex",
alignItems: "center",
- overflowX: "scroll",
minHeight: "25px",
opacity: props.loading ? 0 : 1,
gap: 6