Skip to content

Commit

Permalink
Merge pull request #448 from intersective/bugfix/CORE-6617/chat-messa…
Browse files Browse the repository at this point in the history
…ges-not-appearing-in-real-time

[CORE-6617] Chat messages not appearing in real time - remove test code and console logs
  • Loading branch information
sasangachathumal authored Jun 18, 2024
2 parents fbb0d4b + 3593be3 commit 7c264ee
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/app/chat/chat-room/chat-room.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,15 @@ export class ChatRoomComponent {
}
// message by team
this.utils.getEvent('chat:new-message').subscribe(event => {
console.log('====1===', event);
const receivedMessage = this.getMessageFromEvent(event);
if (this.utils.isEmpty(receivedMessage) || receivedMessage.channelUuid !== this.channelUuid) {
console.log('====2===', this.channelUuid, receivedMessage.channelUuid);
return;
}
// if received message is schedule one need to update count
if (event.isScheduled) {
console.log('====3===');
this.chatChannel.scheduledMessageCount -= 1;
}
if (!this.utils.isEmpty(receivedMessage)) {
console.log('====4===', receivedMessage);
this.messageList.push(receivedMessage);
this._markAsSeen();
this._scrollToBottom();
Expand Down Expand Up @@ -164,7 +160,6 @@ export class ChatRoomComponent {
* @description listen to pusher event for new message
*/
getMessageFromEvent(data): Message {
console.log('====1===1', data);
if (!data) {
return null;
}
Expand Down Expand Up @@ -196,7 +191,6 @@ export class ChatRoomComponent {
) {
receivedMessage.isSender = true;
}
console.log('====1===2', receivedMessage);
return receivedMessage;
}

Expand Down Expand Up @@ -415,7 +409,6 @@ export class ChatRoomComponent {

// call chat api to mark message as seen messages
private _markAsSeen() {
console.log('====4===1');
const messageIds = this.messageList.map(m => m.uuid);
this.chatService
.markMessagesAsSeen(messageIds)
Expand Down Expand Up @@ -592,11 +585,9 @@ export class ChatRoomComponent {
}

private _scrollToBottom() {
console.log('====4===2');
setTimeout(
() => {
this.content.scrollToBottom();
console.log('====4===3');
},
500
);
Expand Down

0 comments on commit 7c264ee

Please sign in to comment.