follow the rabbit to fix potential issues

This commit is contained in:
dakai
2024-10-14 02:33:28 +08:00
parent e64a4f209c
commit 39f5d263f9
4 changed files with 13 additions and 24 deletions

View File

@@ -1122,12 +1122,11 @@ function _Chat() {
};
const updateMessageAudio = (msgId?: string, audio_url?: string) => {
chatStore.updateCurrentSession(
(session) =>
(session.messages = session.messages.map((m) =>
m.id === msgId ? { ...m, audio_url } : m,
)),
);
chatStore.updateCurrentSession((session) => {
session.messages = session.messages.map((m) =>
m.id === msgId ? { ...m, audio_url } : m,
);
});
};
const onDelete = (msgId: string) => {
@@ -1903,7 +1902,6 @@ function _Chat() {
)}
{message.audio_url && (
<audio
id="audio"
preload="auto"
controls
className={styles["chat-message-item-audio"]}