mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
set last message fix
This commit is contained in:
@@ -19,14 +19,17 @@ export class RoomLocalRepository extends DexieRepository<RoomTable, RoomTable> i
|
||||
// }
|
||||
// });
|
||||
|
||||
// chatDatabase.room.hook('updating', (modifications, primKey, obj, transaction) => {
|
||||
chatDatabase.room.hook('updating', (modifications, primKey, oldValue, transaction) => {
|
||||
|
||||
// if((modifications as Partial<RoomTable>).messages?.[0].attachments?.[0]) {
|
||||
// delete (modifications as Partial<RoomTable>).messages[0].attachments[0].file
|
||||
// }
|
||||
if((modifications as Partial<RoomTable>).messages?.[0].requestId == oldValue.messages?.[0].requestId) {
|
||||
(modifications as Partial<RoomTable>).messages[0].sentAt = oldValue.messages?.[0]?.sentAt;
|
||||
} else if ((modifications as Partial<RoomTable>).messages?.[0].id == oldValue.messages?.[0].id) {
|
||||
(modifications as Partial<RoomTable>).messages[0].sentAt = oldValue.messages?.[0]?.sentAt
|
||||
}
|
||||
|
||||
return modifications
|
||||
});
|
||||
|
||||
// return modifications
|
||||
// });
|
||||
}
|
||||
|
||||
getItemsLive() {
|
||||
|
||||
Reference in New Issue
Block a user