Skip to content

Commit

Permalink
chore: update fetch tags
Browse files Browse the repository at this point in the history
  • Loading branch information
boojack committed Nov 19, 2023
1 parent dfa1468 commit 7ef125e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions web/src/components/MemoEditor/ActionButton/TagSelector.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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 (
<IconButton className="relative group flex flex-row justify-center items-center p-1 w-auto h-auto mr-1 select-none rounded cursor-pointer text-gray-600 dark:text-gray-400 hover:bg-gray-300 dark:hover:bg-zinc-800 hover:shadow">
<Icon.Hash className="w-5 h-5 mx-auto" />
Expand Down

0 comments on commit 7ef125e

Please sign in to comment.