This commit is contained in:
tiago.kayaya
2021-09-01 17:14:57 +01:00
parent c7f8d5a583
commit adecc6ebd0
5 changed files with 23 additions and 13 deletions
+13 -3
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';
@@ -151,7 +152,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();
@@ -252,9 +253,18 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
async serverLongPull() {
alert('YAS')
const roomId = this.roomId
this.chatService.getRoomMessages(roomId).subscribe(async res => {
this.chatService.getRoomMessages(roomId).subscribe(res=>{
console.log(res);
})
/* this.chatService.getRoomMessages(roomId).subscribe(async res => {
if (res == 502) {
// Connection timeout
@@ -287,7 +297,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
//this.loadMessages()
await this.serverLongPull();
}
});
}); */
}
}