mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
save
This commit is contained in:
@@ -113,6 +113,7 @@
|
||||
(showEmptyContainer)="showEmptyContainer()"
|
||||
(showEmptyContainer)="showEmptyContainer()"
|
||||
(openNewEventPage)="openNewEventPage($event)"
|
||||
(getDirectMessages)="getDirectMessages($event)"
|
||||
[style.display]="showMessages ? 'flex' : 'none'"
|
||||
[roomId]="roomId"
|
||||
[showMessages]="showMessages" #messagecontainer>
|
||||
@@ -156,6 +157,7 @@
|
||||
(openGroupContacts)="openGroupContactsPage($event)"
|
||||
(openEditGroupPage)="openEditGroupPage($event)"
|
||||
(openNewEventPage)="openNewEventPage($event)"
|
||||
(getGroups)="getGroups($event)"
|
||||
[style.display]="showGroupMessages ? 'flex' : 'none'"
|
||||
class=" height-100 flex-column"
|
||||
[roomId]="roomId" #messagecontainer>
|
||||
|
||||
@@ -374,11 +374,11 @@ hideRefreshButton(){
|
||||
});
|
||||
}
|
||||
|
||||
async getDirectMessages(){
|
||||
async getDirectMessages(event?){
|
||||
|
||||
this.chatService.getAllDirectMessages().subscribe(async (res:any)=>{
|
||||
|
||||
if(res.ims != 200){
|
||||
if(res != 200){
|
||||
console.log(res.ims);
|
||||
this.userDirectMessages = res.ims.sort((a,b)=>{
|
||||
var dateA = new Date(a._updatedAt).getTime();
|
||||
@@ -391,12 +391,17 @@ hideRefreshButton(){
|
||||
console.log("Timer message stop")
|
||||
}
|
||||
else {
|
||||
console.log('TIMER');
|
||||
//Check if modal is opened
|
||||
if(this.segment == "Contactos" && this.showMessages != true){
|
||||
await new Promise(resolve => setTimeout(resolve, 5000));
|
||||
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||
await this.getDirectMessages();
|
||||
console.log('Timer contactos list running')
|
||||
}
|
||||
else{
|
||||
console.log('No timer!');
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
@@ -452,7 +457,7 @@ hideRefreshButton(){
|
||||
});
|
||||
}
|
||||
|
||||
async getGroups(){
|
||||
async getGroups(event?){
|
||||
this.result = this.chatService.getAllPrivateGroups().subscribe(async (res:any)=>{
|
||||
|
||||
if(res.groups != 200){
|
||||
@@ -474,7 +479,7 @@ hideRefreshButton(){
|
||||
else {
|
||||
//Check if modal is opened
|
||||
if(this.segment == "Grupos" && this.showGroupMessages != true){
|
||||
await new Promise(resolve => setTimeout(resolve, 5000));
|
||||
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||
await this.getGroups();
|
||||
console.log('Timer groups list running')
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component, ElementRef, OnInit, ViewChild, AfterViewChecked, AfterViewInit, OnDestroy } from '@angular/core';
|
||||
import { Component, ElementRef, OnInit, ViewChild, AfterViewChecked, AfterViewInit, OnDestroy, } 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';
|
||||
|
||||
@@ -41,6 +41,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
@Output() openGroupContacts:EventEmitter<any> = new EventEmitter<any>();
|
||||
@Output() openEditGroupPage:EventEmitter<any> = new EventEmitter<any>();
|
||||
@Output() openNewEventPage:EventEmitter<any> = new EventEmitter<any>();
|
||||
@Output() getGroups:EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
|
||||
|
||||
@@ -457,8 +458,9 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
console.log("Timer message stop")
|
||||
} else {
|
||||
if(document.querySelector('app-group-messages')){
|
||||
await new Promise(resolve => setTimeout(resolve, 5000));
|
||||
await new Promise(resolve => setTimeout(resolve,3000));
|
||||
await this.serverLongPull();
|
||||
this.getGroups.emit();
|
||||
console.log('Timer message running')
|
||||
}
|
||||
else{
|
||||
|
||||
@@ -37,6 +37,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
@Input() showMessages:string;
|
||||
|
||||
@Output() openNewEventPage:EventEmitter<any> = new EventEmitter<any>();
|
||||
@Output() getDirectMessages:EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
|
||||
synchro = synchro;
|
||||
@@ -371,6 +372,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
if(document.querySelector('app-messages')){
|
||||
await new Promise(resolve => setTimeout(resolve, 5000));
|
||||
await this.serverLongPull();
|
||||
this.getDirectMessages.emit();
|
||||
console.log('Timer message running')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user