mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
fix direct room
This commit is contained in:
@@ -11,11 +11,13 @@ export function roomListDetermineChanges(serverRooms: RoomListItemOutPutDTO[], l
|
||||
const roomsToUpdate = serverRooms.filter(room => {
|
||||
const localRoom = localRoomMap.get(room.chatRoom.id);
|
||||
|
||||
console.log(room.chatRoom, localRoom)
|
||||
|
||||
return localRoom && (
|
||||
room.chatRoom.roomName !== localRoom.roomName && room.chatRoom.roomType == RoomType.Group ||
|
||||
room.chatRoom.createdBy.wxUserId !== localRoom.createdBy.wxUserId ||
|
||||
room.chatRoom.createdAt !== localRoom.createdAt ||
|
||||
room.chatRoom.expirationDate !== localRoom.expirationDate // ||
|
||||
room.chatRoom.createdAt !== localRoom.createdAt
|
||||
//room.chatRoom.expirationDate !== localRoom.expirationDate // ||
|
||||
// room.chatRoom.messages?.[0]?.id !== localRoom.messages?.[0]?.id
|
||||
// room.chatRoom.roomType !== localRoom.roomType
|
||||
);
|
||||
|
||||
@@ -47,6 +47,10 @@ export class RoomLocalRepository extends DexieRepository<RoomTable, RoomTable> i
|
||||
(modifications as Partial<RoomTable>).local = IDBoolean.true
|
||||
}
|
||||
|
||||
if((modifications as Partial<RoomTable>).id && !oldValue.id && oldValue.roomType == RoomType.Direct) {
|
||||
return this.listenCreateSyncSubject.next({...oldValue, ...modifications})
|
||||
}
|
||||
|
||||
return modifications
|
||||
});
|
||||
|
||||
@@ -60,5 +64,10 @@ export class RoomLocalRepository extends DexieRepository<RoomTable, RoomTable> i
|
||||
return from(liveQuery(() => chatDatabase.room.get(id)));
|
||||
}
|
||||
|
||||
|
||||
OnSetIdToDirectRoom() {
|
||||
return this.listenCreateSyncSubject.asObservable()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user