From 7ef125e3af33b0045c77fdf9a2db767c70b16de5 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 19 Nov 2023 11:01:04 +0800 Subject: [PATCH] chore: update fetch tags --- .../MemoEditor/ActionButton/TagSelector.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/web/src/components/MemoEditor/ActionButton/TagSelector.tsx b/web/src/components/MemoEditor/ActionButton/TagSelector.tsx index 72e5a60b..f9cbbd97 100644 --- a/web/src/components/MemoEditor/ActionButton/TagSelector.tsx +++ b/web/src/components/MemoEditor/ActionButton/TagSelector.tsx @@ -1,4 +1,5 @@ import { IconButton } from "@mui/joy"; +import { useEffect } from "react"; import Icon from "@/components/Icon"; import OverflowTip from "@/components/kit/OverflowTip"; import { useTagStore } from "@/store/module"; @@ -12,6 +13,16 @@ const TagSelector = (props: Props) => { const tagStore = useTagStore(); const tags = tagStore.state.tags; + useEffect(() => { + (async () => { + try { + await tagStore.fetchTags(); + } catch (error) { + // do nothing. + } + })(); + }, []); + return (