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
+28 -3
View File
@@ -21,6 +21,10 @@ import { NetworkServiceService} from 'src/app/services/network-service.service';
import { ViewedMessageService } from './viewed-message.service'
import { NotificationsService } from '../notifications.service';
import { Subscribe } from '../subcribe';
import { Plugins } from '@capacitor/core';
const { App } = Plugins;
@Injectable({
providedIn: 'root'
})
@@ -103,16 +107,37 @@ export class ChatSystemService {
}
document.addEventListener('resume', function () {
if(SessionStore.user?.ChatData?.data) {
this.restoreRooms();
}
document.addEventListener('resume', () => {
this.RochetChatConnectorService.setStatus('online')
if(this._dm?.length == 0 && this._group?.length == 0) {
this.getAllRooms();
}
});
if (!this.platform.is('desktop')) {
App.addListener('appStateChange', ({ isActive }) => {
if (isActive) {
// The app is in the foreground.
console.log('App is in the foreground');
if(SessionStore.user?.ChatData?.data) {
this.restoreRooms();
this.currentRoom?.loadHistory({forceUpdate: true})
setTimeout(() => {
this.subscribeToRoom()
this.RochetChatConnectorService.setStatus('online')
},1000);
/* 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.
}
});
}
}