mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: fix update storage
This commit is contained in:
@ -82,6 +82,7 @@ const CreateStorageServiceDialog: React.FC<Props> = (props: Props) => {
|
|||||||
} else {
|
} else {
|
||||||
await storageServiceClient.updateStorage({
|
await storageServiceClient.updateStorage({
|
||||||
storage: Storage.fromPartial({
|
storage: Storage.fromPartial({
|
||||||
|
id: storage?.id,
|
||||||
title: basicInfo.title,
|
title: basicInfo.title,
|
||||||
type: type,
|
type: type,
|
||||||
config: {
|
config: {
|
||||||
|
@ -25,7 +25,6 @@ const TagsSection = () => {
|
|||||||
const filterStore = useFilterStore();
|
const filterStore = useFilterStore();
|
||||||
const tagStore = useTagStore();
|
const tagStore = useTagStore();
|
||||||
const memoList = useMemoList();
|
const memoList = useMemoList();
|
||||||
const tagsText = Array.from(tagStore.getState().tags);
|
|
||||||
const filter = filterStore.state;
|
const filter = filterStore.state;
|
||||||
const [tags, setTags] = useState<Tag[]>([]);
|
const [tags, setTags] = useState<Tag[]>([]);
|
||||||
|
|
||||||
@ -38,7 +37,7 @@ const TagsSection = () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const sortedTags = tagsText.sort();
|
const sortedTags = Array.from(tagStore.getState().tags).sort();
|
||||||
const root: KVObject<any> = {
|
const root: KVObject<any> = {
|
||||||
subTags: [],
|
subTags: [],
|
||||||
};
|
};
|
||||||
@ -57,7 +56,6 @@ const TagsSection = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let obj = tempObj.subTags.find((t: Tag) => t.text === tagText);
|
let obj = tempObj.subTags.find((t: Tag) => t.text === tagText);
|
||||||
|
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
obj = {
|
obj = {
|
||||||
key,
|
key,
|
||||||
@ -72,7 +70,7 @@ const TagsSection = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setTags(root.subTags as Tag[]);
|
setTags(root.subTags as Tag[]);
|
||||||
}, [tagsText.join(",")]);
|
}, [tagStore.getState().tags]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col justify-start items-start w-full mt-3 px-1 h-auto shrink-0 flex-nowrap hide-scrollbar">
|
<div className="flex flex-col justify-start items-start w-full mt-3 px-1 h-auto shrink-0 flex-nowrap hide-scrollbar">
|
||||||
|
Reference in New Issue
Block a user