mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
code refactoring
This commit is contained in:
@@ -23,7 +23,8 @@ import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { Observable as DexieObservable } from 'Dexie';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { MessageRepositoryService } from 'src/app/module/chat/data/repository/message-respository.service'
|
||||
import { RoomRepositoryService } from 'src/app/module/chat/data/repository/room-repository.service'
|
||||
import { RoomLocalRepository } from 'src/app/module/chat/data/repository/room-local-repository.service'
|
||||
import { MemberListLocalRepository } from 'src/app/module/chat/data/repository/member-list-local-repository.service'
|
||||
import { MessageTable } from 'src/app/module/chat/infra/database/dexie/schema/message';
|
||||
import { RoomListItemOutPutDTO } from 'src/app/module/chat/data/dto/room/roomListOutputDTO';
|
||||
import { UserTypingServiceRepository } from 'src/app/module/chat/data/repository/user-typing-repository.service';
|
||||
@@ -148,7 +149,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
private platform: Platform,
|
||||
private fileOpener: FileOpener,
|
||||
public p: PermissionService,
|
||||
private roomRepositoryService: RoomRepositoryService,
|
||||
private MemberListLocalRepository: MemberListLocalRepository,
|
||||
private messageRepositoryService: MessageRepositoryService,
|
||||
private userTypingServiceRepository: UserTypingServiceRepository,
|
||||
private chatServiceService: ChatServiceService,
|
||||
@@ -156,6 +157,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
private FilePickerWebService: FilePickerWebService,
|
||||
private FilePickerService: FilePickerService,
|
||||
private SpeakerService: SpeakerService,
|
||||
private RoomLocalRepository: RoomLocalRepository
|
||||
) {
|
||||
// update
|
||||
this.checkAudioPermission()
|
||||
@@ -164,7 +166,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
|
||||
|
||||
this.roomData$ = this.roomRepositoryService.getItemByIdLive(this.roomId)
|
||||
this.roomData$ = this.RoomLocalRepository.getRoomByIdLive(this.roomId)
|
||||
this.getMessages();
|
||||
this.listenToIncomingMessage();
|
||||
this.listenToDeleteMessage();
|
||||
@@ -172,9 +174,9 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
this.listenToSendMessage()
|
||||
|
||||
// this.roomMessage$ = this.messageRepositoryService.getItemsLive(this.roomId)
|
||||
this.roomMembers$ = this.roomRepositoryService.getRoomMemberByIdLive(this.roomId) as any
|
||||
this.roomStatus$ = this.roomRepositoryService.getRoomStatus(this.roomId)
|
||||
this.roomRepositoryService.getRoomById(this.roomId)
|
||||
this.roomMembers$ = this.MemberListLocalRepository.getRoomMemberByIdLive(this.roomId) as any
|
||||
this.roomStatus$ = this.MemberListLocalRepository.allMemberOnline(this.roomId)
|
||||
this.chatServiceService.getRoomById(this.roomId)
|
||||
|
||||
this.userTypingServiceRepository.getUserTypingLive().subscribe((e) => {
|
||||
const arrayNames = e.map(e => e.userName)
|
||||
@@ -194,7 +196,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
this.messages1[this.roomId] = []
|
||||
this.messages1[this.roomId] = messages
|
||||
|
||||
|
||||
this.messages1[this.roomId].push(LastMessage)
|
||||
|
||||
this.loadAttachment()
|
||||
@@ -212,8 +214,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
message.attachments[0].safeFile = result.value
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -229,7 +231,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
this.messages1[this.roomId].splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async onImageError() {}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user