fix open pdf and member list

This commit is contained in:
Peter Maquiran
2024-09-19 23:36:59 +01:00
parent 1f08eb5514
commit 9da65a1e7b
18 changed files with 215 additions and 53 deletions
+35 -2
View File
@@ -38,9 +38,9 @@ export class RoomStore {
messageTypingSubject: Subscription
messageOnReconnectSubject: Subscription
messageOnSetRoomId: Subscription
messageRoomData: Subscription
newMessagesStream!: Subscription
roomData$: Observable<RoomTable | undefined>
roomStatus$: DexieObservable<Boolean >
roomMessage$: DexieObservable<MessageTable[]>
roomMembers$: Observable<MemberTable[] | undefined>
@@ -71,10 +71,41 @@ export class RoomStore {
} else {
await this.getMessages()
}
this.messageRoomData?.unsubscribe();
this.messageRoomData = this.RoomLocalRepository.getRoomByIdLive(this.room.$id).subscribe(e => {
if(e) {
this.room = new RoomViewModel(e)
}
})
this.messageOnSetRoomId?.unsubscribe()
if(this.room.local == IDBoolean.true) {
this.messageOnSetRoomId = this.chatServiceService.roomDirectOnSetId({$roomId: this.room.$id}).subscribe((data) => {
this.messageOnSetRoomId?.unsubscribe()
this.room = new RoomViewModel(data)
const hasMyMessage = this.messages1[this.room.$id].find(e => e.sender.wxUserId == SessionStore.user.UserId)
if(!hasMyMessage) {
setTimeout(() => {
this.getMessages()
}, 500)
}
setTimeout(() => {
this.subscribeToChanges()
}, 500)
})
}
}
stop() {
this.messageReceiveSubject?.unsubscribe();
this.messageReceiveSubject?.unsubscribe();
this.messageDeleteSubject?.unsubscribe();
this.messageUpdateSubject?.unsubscribe();
@@ -194,6 +225,8 @@ export class RoomStore {
}
}
this.sendReadMessage()
setTimeout(() => {
this.scrollToBottomClicked()
}, 100)