mirror of
https://github.com/usememos/memos.git
synced 2024-12-19 17:12:02 +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 { IconButton } from "@mui/joy";
|
||||||
|
import { useEffect } from "react";
|
||||||
import Icon from "@/components/Icon";
|
import Icon from "@/components/Icon";
|
||||||
import OverflowTip from "@/components/kit/OverflowTip";
|
import OverflowTip from "@/components/kit/OverflowTip";
|
||||||
import { useTagStore } from "@/store/module";
|
import { useTagStore } from "@/store/module";
|
||||||
@ -12,6 +13,16 @@ const TagSelector = (props: Props) => {
|
|||||||
const tagStore = useTagStore();
|
const tagStore = useTagStore();
|
||||||
const tags = tagStore.state.tags;
|
const tags = tagStore.state.tags;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
(async () => {
|
||||||
|
try {
|
||||||
|
await tagStore.fetchTags();
|
||||||
|
} catch (error) {
|
||||||
|
// do nothing.
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
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">
|
<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" />
|
<Icon.Hash className="w-5 h-5 mx-auto" />
|
||||||
|
Loading…
Reference in New Issue
Block a user