Fix sorting links when editing and handle not providing any data

This commit is contained in:
Isaac Wise
2024-02-11 01:01:52 -06:00
parent e753f1dded
commit 63597a041f
7 changed files with 45 additions and 32 deletions
+1 -1
View File
@@ -148,7 +148,7 @@ const useLinkStore = create<LinkStore>()((set) => ({
if (response.ok) {
set((state) => ({
links: state.links.map((e) =>
links.some((link) => link.id === e.id) ? { ...e, ...newData } : e
links.some((link) => link.id === e.id) ? { ...e, tags: [...e.tags, ...(newData.tags ?? [])] } : e
),
}));
useTagStore.getState().setTags();