From 33ea3344ffd63ba8a5cd0f4279b33ba44953e052 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 20 Apr 2024 02:44:19 +0300 Subject: [PATCH] Insert messages to chat load with splice --- public/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/script.js b/public/script.js index 1d7318e7b..dc0e60862 100644 --- a/public/script.js +++ b/public/script.js @@ -5654,7 +5654,7 @@ async function getChat() { contentType: 'application/json', }); if (response[0] !== undefined) { - chat.push(...response); + chat.splice(0, chat.length, ...response); chat_create_date = chat[0]['create_date']; chat_metadata = chat[0]['chat_metadata'] ?? {};