mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
git pull made
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user