fix: updating the array using push in zustand does not actually trigger component updates

This commit is contained in:
Jiacheng Dong 2023-06-15 10:55:25 +08:00 committed by GitHub
parent e636d486f5
commit 1d42e955fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -317,8 +317,10 @@ export const useChatStore = create<ChatStore>()(
botMessage.streaming = false;
userMessage.isError = !isAborted;
botMessage.isError = !isAborted;
set(() => ({}));
get().updateCurrentSession((session) => {
session.messages = session.messages.concat();
});
// set(() => ({}));
ChatControllerPool.remove(
sessionIndex,
botMessage.id ?? messageIndex,