Insert group chat history with splice

This commit is contained in:
Cohee 2024-04-21 21:12:41 +03:00
parent 842b463e60
commit e832af9854

View File

@ -188,9 +188,7 @@ export async function getGroupChat(groupId, reload = false) {
if (Array.isArray(data) && data.length) { if (Array.isArray(data) && data.length) {
data[0].is_group = true; data[0].is_group = true;
for (let key of data) { chat.splice(0, chat.length, ...data);
chat.push(key);
}
await printMessages(); await printMessages();
} else { } else {
sendSystemMessage(system_message_types.GROUP, '', { isSmallSys: true }); sendSystemMessage(system_message_types.GROUP, '', { isSmallSys: true });