fix table notification permision and chat open conversation

This commit is contained in:
Lorito Tiago
2023-10-11 10:18:01 +01:00
parent cca49822b3
commit 3007cf6897
5 changed files with 395 additions and 35 deletions
+7 -6
View File
@@ -108,6 +108,7 @@ export class ChatPage implements OnInit {
showEventEditOrOpen: "edit" | "add" | "" | "eventoToApprove" = ""
socket: WebSocket;
receivedData: any;
routerSubscription
constructor(
private chatService: ChatService,
@@ -167,7 +168,7 @@ export class ChatPage implements OnInit {
}
});
this.router.events.forEach((event) => {
this.routerSubscription = this.router.events.subscribe((event) => {
if (event instanceof NavigationEnd && event.url.startsWith('/home/chat')) {
this.routeCheck()
}
@@ -176,6 +177,11 @@ export class ChatPage implements OnInit {
this.routeCheck()
}
ngOnDestroy() {
// this.setStatus('offline');
this.routerSubscription?.unsubscribe();
}
reopenWebSocketConnection() {
// Implement your reconnection logic here.
const newWebSocket = new WebSocket(environment.apiWsChatUrl);
@@ -218,11 +224,6 @@ export class ChatPage implements OnInit {
return Array(n);
}
ngOnDestroy() {
this.setStatus('offline');
}
setStatus(status: string) {
let body = {
message: '',