mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
fix table notification permision and chat open conversation
This commit is contained in:
@@ -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: '',
|
||||
|
||||
Reference in New Issue
Block a user