diff --git a/src/app/pages/chat/chat.page.ts b/src/app/pages/chat/chat.page.ts index 9ceffc36b..a15c12fd3 100644 --- a/src/app/pages/chat/chat.page.ts +++ b/src/app/pages/chat/chat.page.ts @@ -234,6 +234,7 @@ export class ChatPage implements OnInit { } openMessagesPage(rid) { + this.chatService.refreshtoken(); this.roomId = rid; if (window.innerWidth < 701) { @@ -281,6 +282,7 @@ export class ChatPage implements OnInit { } openGroupMessagesPage(rid) { + this.chatService.refreshtoken(); this.roomId = rid; if (window.innerWidth < 701) { diff --git a/src/app/services/chat/room.service.ts b/src/app/services/chat/room.service.ts index 01757f453..ba9728df2 100644 --- a/src/app/services/chat/room.service.ts +++ b/src/app/services/chat/room.service.ts @@ -77,7 +77,6 @@ export class RoomService { } sortRoomList = () => {} - uploadAttachment = (formData) => {} constructor( public WsChatService: WsChatService, @@ -622,7 +621,7 @@ export class RoomService { } private typingWatch() { - setTimeout(()=>{ + setTimeout(() => { const now = new Date().getTime() if((now - this.lastTimeType) >= 2888) { @@ -631,8 +630,6 @@ export class RoomService { this.isTyping = false this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', this.isTyping) } - } else { - } }, 3000) diff --git a/src/app/shared/chat/group-messages/group-messages.page.ts b/src/app/shared/chat/group-messages/group-messages.page.ts index 909d35565..a6743aa7c 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.ts +++ b/src/app/shared/chat/group-messages/group-messages.page.ts @@ -144,17 +144,14 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe } ngOnChanges(changes: SimpleChanges): void { - + this.chatService.refreshtoken(); this.getRoomInfo(); - //this.scrollToBottom(); this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory({}); // this.wsChatMethodsService.openRoom(this.roomId) this.wsChatMethodsService.getGroupRoom(this.roomId).scrollDown = this.scrollToBottomClicked this.groupNameFormart = this.wsChatMethodsService.getGroupRoom(this.roomId).name.split('-').join(' ') - - this.showAvatar = false setTimeout(() => { diff --git a/src/app/shared/chat/messages/messages.page.ts b/src/app/shared/chat/messages/messages.page.ts index f7a181c8b..79b9057c8 100644 --- a/src/app/shared/chat/messages/messages.page.ts +++ b/src/app/shared/chat/messages/messages.page.ts @@ -130,6 +130,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy } ngOnChanges(changes: SimpleChanges): void { + + this.chatService.refreshtoken(); this.wsChatMethodsService.getAllRooms(); this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({}) @@ -137,10 +139,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy this.wsChatMethodsService.openRoom(this.roomId) - this.wsChatMethodsService.getDmRoom(this.roomId).uploadAttachment = async (formData) => { - let guid: any = await this.AttachmentsService.uploadFile(formData).toPromise() - } - this.showAvatar = false setTimeout(() => { @@ -531,11 +529,11 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy // //this.showLoader = true; - this.chatService.getMembers(this.roomId).subscribe(res => { - this.members = res['members']; - this.dmUsers = res['members'].filter(data => data.username != this.sessionStore.user.UserName) - this.showLoader = false; - }); + // this.chatService.getMembers(this.roomId).subscribe(res => { + // this.members = res['members']; + // this.dmUsers = res['members'].filter(data => data.username != this.sessionStore.user.UserName) + // this.showLoader = false; + // }); } async openMessagesOptions(ev: any) {