This commit is contained in:
tiago.kayaya
2021-07-26 14:09:26 +01:00
parent 8be47ab2e7
commit 2ca3859f87
5 changed files with 41 additions and 27 deletions
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, ElementRef, OnInit, ViewChild } 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';
@@ -30,6 +30,8 @@ export class GroupMessagesPage implements OnInit {
roomId: string;
loggedUserChat:any;
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
constructor(
private menu: MenuController,
private modalController: ModalController,
@@ -51,8 +53,14 @@ export class GroupMessagesPage implements OnInit {
this.getRoomInfo();
}
notImplemented(){
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
ngAfterViewChecked() {
this.scrollToBottom();
}
scrollToBottom(): void {
try {
this.myScrollContainer.nativeElement.scrollTop = this.myScrollContainer.nativeElement.scrollHeight;
} catch(err) { }
}
getRoomInfo(){