remove console logs

This commit is contained in:
Peter Maquiran
2023-09-27 08:44:35 +01:00
parent 1f2827680d
commit b46d179dfe
4 changed files with 57 additions and 71 deletions
-53
View File
@@ -31,7 +31,6 @@ import { ChatDebuggingPage } from 'src/app/shared/popover/chat-debugging/chat-de
import { EventTrigger } from 'src/app/services/eventTrigger.service';
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
import { Plugins } from '@capacitor/core';
const { App } = Plugins;
@@ -175,58 +174,6 @@ export class ChatPage implements OnInit {
});
this.routeCheck()
if (!this.platform.is('desktop')) {
App.addListener('appStateChange', ({ isActive }) => {
if (isActive) {
// The app is in the foreground.
console.log('App is in the foreground');
setTimeout(() => {
this.ChatSystemService.subscribeToRoom()
this.RochetChatConnectorService.setStatus('online')
},1000);
/* const webSocketURL = environment.apiWsChatUrl;
const ws = new WebSocket(webSocketURL);
ws.addEventListener('open', () => {
console.log('WebSocket connection opened');
});
ws.addEventListener('message', (event) => {
const data = JSON.parse(event.data);
// Handle incoming messages from the Rocket.Chat server.
console.log('Received message:', data);
});
ws.addEventListener('close', (event) => {
console.log('WebSocket connection closed', event);
// Optionally, attempt to reopen the connection when it's closed.
// You can implement a reconnect strategy here.
setTimeout(() => {
this.reopenWebSocketConnection();
}, 5000); // Reopen the connection after 5 seconds (adjust as needed).
});
this.RochetChatConnectorService.sendStreamNotifyRoom("26XgGhKghKN8fN6v8KvDfW9jrjhKhoAWhM", SessionStore.user.UserName, 'typing', true).catch((error) => console.error(error));
ws.addEventListener('error', (error) => {
console.error('WebSocket error:', error);
// Handle WebSocket errors here.
});
*/
/* this.reloadComponent(true) */
} else {
// The app is in the background.
console.log('App is in the background');
// You can perform actions specific to the background state here.
}
});
}
}
reopenWebSocketConnection() {