Skip to content

Commit

Permalink
fix: update UI when remove tags from search results
Browse files Browse the repository at this point in the history
  • Loading branch information
gnekoz committed Sep 19, 2024
1 parent 39c6a69 commit c0edd69
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/store/zustand/search/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ export function updateConversationsOnly(conversations: Array<NormalizedConversat
useMessageStore.setState(
produce(({ populatedItems }: PopulatedItemsSliceState) => {
conversations.forEach((conversation) => {
populatedItems.conversations[conversation.id] = merge(
populatedItems.conversations[conversation.id],
conversation
);
populatedItems.conversations[conversation.id] = {
...merge(populatedItems.conversations[conversation.id], conversation),
tags: conversation.tags
};
});
})
);
Expand Down Expand Up @@ -170,7 +170,10 @@ export function updateMessagesOnly(messages: Array<IncompleteMessage>): void {
useMessageStore.setState(
produce(({ populatedItems }: PopulatedItemsSliceState) => {
messages.forEach((message) => {
populatedItems.messages[message.id] = merge(populatedItems.messages[message.id], message);
populatedItems.messages[message.id] = {
...merge(populatedItems.messages[message.id], message),
tags: message.tags
};
});
})
);
Expand Down

0 comments on commit c0edd69

Please sign in to comment.