From cdcb61da1783c5c362d8dc2a573f7d1cad3f68ca Mon Sep 17 00:00:00 2001 From: Steven Date: Wed, 24 Apr 2024 09:18:33 +0800 Subject: [PATCH] chore: fix update storage --- web/src/components/CreateStorageServiceDialog.tsx | 1 + web/src/components/HomeSidebar/TagsSection.tsx | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/web/src/components/CreateStorageServiceDialog.tsx b/web/src/components/CreateStorageServiceDialog.tsx index ecceadbd..d99bf7b1 100644 --- a/web/src/components/CreateStorageServiceDialog.tsx +++ b/web/src/components/CreateStorageServiceDialog.tsx @@ -82,6 +82,7 @@ const CreateStorageServiceDialog: React.FC = (props: Props) => { } else { await storageServiceClient.updateStorage({ storage: Storage.fromPartial({ + id: storage?.id, title: basicInfo.title, type: type, config: { diff --git a/web/src/components/HomeSidebar/TagsSection.tsx b/web/src/components/HomeSidebar/TagsSection.tsx index ce1256bb..f4315b19 100644 --- a/web/src/components/HomeSidebar/TagsSection.tsx +++ b/web/src/components/HomeSidebar/TagsSection.tsx @@ -25,7 +25,6 @@ const TagsSection = () => { const filterStore = useFilterStore(); const tagStore = useTagStore(); const memoList = useMemoList(); - const tagsText = Array.from(tagStore.getState().tags); const filter = filterStore.state; const [tags, setTags] = useState([]); @@ -38,7 +37,7 @@ const TagsSection = () => { ); useEffect(() => { - const sortedTags = tagsText.sort(); + const sortedTags = Array.from(tagStore.getState().tags).sort(); const root: KVObject = { subTags: [], }; @@ -57,7 +56,6 @@ const TagsSection = () => { } let obj = tempObj.subTags.find((t: Tag) => t.text === tagText); - if (!obj) { obj = { key, @@ -72,7 +70,7 @@ const TagsSection = () => { } setTags(root.subTags as Tag[]); - }, [tagsText.join(",")]); + }, [tagStore.getState().tags]); return (