chat rooms sorting bug fixing
This commit is contained in:
parent
441516a472
commit
c0c31e16e4
|
|
@ -196,8 +196,14 @@ 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) {
|
if (index != 0 &&
|
||||||
Room room = val!.value.data[index];
|
(val!.value.data[index].lastMessageDate.hour == DateTime.now().hour &&
|
||||||
|
val.value.data[index].lastMessageDate.day == DateTime.now().day &&
|
||||||
|
val.value.data[index].lastMessageDate.month ==
|
||||||
|
DateTime.now().month &&
|
||||||
|
val.value.data[index].lastMessageDate.year ==
|
||||||
|
DateTime.now().year)) {
|
||||||
|
Room room = val.value.data[index];
|
||||||
val.value.data.removeAt(index);
|
val.value.data.removeAt(index);
|
||||||
val.value.data.insert(0, room);
|
val.value.data.insert(0, room);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user