This commit is contained in:
tiago.kayaya
2021-07-26 14:34:52 +01:00
parent a390c00797
commit b75027fd98
4 changed files with 20 additions and 13 deletions
@@ -1,4 +1,4 @@
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { Component, ElementRef, OnInit, ViewChild, AfterViewChecked } from '@angular/core';
import { ActionSheetController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
import { AlertService } from 'src/app/services/alert.service';
import { AuthService } from 'src/app/services/auth.service';
@@ -14,7 +14,7 @@ import { GroupContactsPage } from './group-contacts/group-contacts.page';
templateUrl: './group-messages.page.html',
styleUrls: ['./group-messages.page.scss'],
})
export class GroupMessagesPage implements OnInit {
export class GroupMessagesPage implements OnInit, AfterViewChecked {
showLoader: boolean;
isGroupCreated:boolean;
loggedUser: any;
@@ -51,6 +51,7 @@ export class GroupMessagesPage implements OnInit {
console.log(this.roomId);
this.loggedUser=this.loggedUserChat;
this.getRoomInfo();
this.scrollToBottom();
}
ngAfterViewChecked() {
@@ -127,12 +128,8 @@ export class GroupMessagesPage implements OnInit {
}
}
sendMessage(){
let body = {
"message":
{
"rid": this.roomId, "msg": this.message
}
"message": { "rid": this.roomId, "msg": this.message }
}
this.chatService.sendMessage(body).subscribe(res=> {