git pull made

This commit is contained in:
Eudes Inácio
2021-09-07 12:18:12 +01:00
148 changed files with 1885 additions and 2257 deletions
+16 -1
View File
@@ -1,6 +1,7 @@
import { AfterViewChecked, AfterViewInit, Component, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router'
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { map } from 'rxjs/operators';
import { ContactsPage } from 'src/app/pages/chat/messages/contacts/contacts.page';
import { AlertService } from 'src/app/services/alert.service';
import { AuthService } from 'src/app/services/auth.service';
@@ -59,6 +60,12 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}); */
this.loggedUser = authService.ValidatedUserChat['data'];
this.roomId = this.navParams.get('roomId');
window.onresize = (event) => {
if( window.innerWidth > 701){
this.modalController.dismiss();
}
};
}
ngOnInit() {
@@ -151,7 +158,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
loadMessages() {
this.showLoader = true;
const roomId = this.roomId
this.chatService.getRoomMessages(this.roomId).subscribe(res => {
/* console.log(res); */
this.messages = res['messages'].reverse();
@@ -254,9 +261,17 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
async serverLongPull() {
const roomId = this.roomId
/* this.chatService.getRoomMessages(roomId).subscribe(res=>{
console.log(res);
}) */
this.chatService.getRoomMessages(roomId).subscribe(async res => {
console.log("Chat message",res)
if (res == 502) {
// Connection timeout
// happens when the synchro was pending for too long