mirror of
https://github.com/usememos/memos.git
synced 2024-12-18 16:41:44 +03:00
chore: update fetch tags
This commit is contained in:
parent
dfa14689e4
commit
7ef125e3af
@ -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 (
|
||||
<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" />
|
||||
|
Loading…
Reference in New Issue
Block a user