mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Merge branch 'feature/websocket' of https://bitbucket.org/equilibriumito/gabinete-digital into feature/websocket
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
import { ModalController, Platform } from '@ionic/angular';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
import { ChatService as ChatServiceGPR} from 'src/app/services/chat/chat.service'
|
||||
import { GroupMessagesPage } from './group-messages/group-messages.page';
|
||||
import { ContactsPage } from './messages/contacts/contacts.page';
|
||||
import { MessagesPage } from './messages/messages.page';
|
||||
@@ -126,9 +127,11 @@ export class ChatPage implements OnInit {
|
||||
private sqlservice: SqliteService,
|
||||
private platform: Platform,
|
||||
private storageservice: StorageService,
|
||||
public ChatServiceGPR: ChatServiceGPR,
|
||||
private wsService: WebsocketService,
|
||||
|
||||
) {
|
||||
|
||||
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
||||
this.headers = new HttpHeaders();
|
||||
window.onresize = (event) => {
|
||||
@@ -136,6 +139,7 @@ export class ChatPage implements OnInit {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
};
|
||||
|
||||
this.showLoader = true;
|
||||
|
||||
console.log("CHAT PAGE");
|
||||
@@ -143,6 +147,8 @@ export class ChatPage implements OnInit {
|
||||
wsService.messages.subscribe(msg => {
|
||||
console.log("Response from Websocket server: "+msg);
|
||||
});
|
||||
|
||||
this.load()
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -583,7 +589,7 @@ export class ChatPage implements OnInit {
|
||||
//Check if modal is opened
|
||||
if (this.segment == "Contactos" && this.showMessages != true) {
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
await this.getDirectMessages();
|
||||
//await this.getDirectMessages();
|
||||
//console.log('Timer contactos list running')
|
||||
}
|
||||
else {
|
||||
@@ -592,7 +598,7 @@ export class ChatPage implements OnInit {
|
||||
}
|
||||
}
|
||||
else {
|
||||
await this.getDirectMessages();
|
||||
//await this.getDirectMessages();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -747,12 +753,12 @@ export class ChatPage implements OnInit {
|
||||
//Check if modal is opened
|
||||
if (this.segment == "Grupos" && this.showGroupMessages != true) {
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
await this.getGroups();
|
||||
//await this.getGroups();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
await this.getGroups();
|
||||
//await this.getGroups();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user