Update group-chats.js

After deleting a group chat, the oldest chat became active. I've fixed it so that the most recent chat becomes active instead.
This commit is contained in:
berbant 2024-02-25 21:11:56 +04:00 committed by GitHub
parent 9e5505a7d4
commit 670f08fad2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1622,7 +1622,7 @@ export async function deleteGroupChat(groupId, chatId) {
if (response.ok) {
if (group.chats.length) {
await openGroupChat(groupId, group.chats[0]);
await openGroupChat(groupId, group.chats[group.chats.length-1]);
} else {
await createNewGroupChat(groupId);
}