Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

chore: fix update storage

Stevencdcb61da1783
diff --git a/web/src/components/CreateStorageServiceDialog.tsx b/web/src/components/CreateStorageServiceDialog.tsx
index ecceadbd7..d99bf7b1f 100644
--- a/web/src/components/CreateStorageServiceDialog.tsx
+++ b/web/src/components/CreateStorageServiceDialog.tsx
@@ -82,6 +82,7 @@ const CreateStorageServiceDialog: React.FC<Props> = (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 ce1256bb3..f4315b198 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<Tag[]>([]);
@@ -38,7 +37,7 @@ const TagsSection = () => {
);
useEffect(() => {
- const sortedTags = tagsText.sort();
+ const sortedTags = Array.from(tagStore.getState().tags).sort();
const root: KVObject<any> = {
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 (
<div className="flex flex-col justify-start items-start w-full mt-3 px-1 h-auto shrink-0 flex-nowrap hide-scrollbar">