chats sorting bug on chatting with old room fixed

This commit is contained in:
MhdZiadHirati 2023-10-25 12:22:06 +03:00
parent dcfd9ffce7
commit aa3fd49d81

View File

@ -196,6 +196,11 @@ class ChatController extends GetxController {
val.value.data[index].lastMessageDate = val.value.data[index].lastMessageDate =
currentRoom.value!.messages.data[0].createdAt; currentRoom.value!.messages.data[0].createdAt;
} }
if (index != 0) {
Room room = val!.value.data[index];
val.value.data.removeAt(index);
val.value.data.insert(0, room);
}
}); });
rooms.refresh(); rooms.refresh();
} }