diff --git a/.gitignore b/.gitignore index ddffe41bb..bf8107e10 100644 --- a/.gitignore +++ b/.gitignore @@ -71,4 +71,5 @@ android/app/src/main/res/** ___android/ _android/ -_www/ \ No newline at end of file +_www/ +www2020 \ No newline at end of file diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index b3e1bda3f..3c1e4ee46 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -11,10 +11,12 @@ import { PermissionService } from '../services/permission.service'; import { BackgroundService } from 'src/app/services/background.service'; import { Storage } from '@ionic/storage'; import { EventsService } from 'src/app/services/events.service'; +import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service'; import { ProcessesService } from 'src/app/services/processes.service'; import { SqliteService } from 'src/app/services/sqlite.service'; import { Device } from '@capacitor/device'; import { RouteService } from 'src/app/services/route.service'; +import { NetworkServiceService, ConnectionStatus } from 'src/app/services/network-service.service'; import { NativeNotificationService } from 'src/app/services/native-notification.service'; import { UserSession } from '../models/user.model'; import { PermissionList } from '../models/permission/permissionList'; @@ -85,6 +87,8 @@ export class HomePage implements OnInit { public RouteService: RouteService, private NativeNotificationService: NativeNotificationService, private sqliteservice: SqliteService, + private RochetChatConnectorService: RochetChatConnectorService, + private NetworkServiceService: NetworkServiceService ) { if (SessionStore.exist) { this.user = SessionStore.user; @@ -139,14 +143,26 @@ export class HomePage implements OnInit { this.notificationsService.onReciveBackground(); window.addEventListener('online', () => { - // console.log('Became online') this.backgroundservice.online() if (this.platform.is('desktop') || this.platform.is('mobileweb')) { } else { this.synchWhenOnline() } - }); + + this.RochetChatConnectorService.registerCallback({ + type: 'reConnect', + funx: async () => { + this.backgroundservice.online() + } + }) + + this.NetworkServiceService.onNetworkChange().subscribe((status) => { + if(status == ConnectionStatus.Online) { + this.backgroundservice.online() + } + }) + window.addEventListener('offline', () => { // console.log('Became offline') this.backgroundservice.offline() diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index 8dac8fd1a..a34d2ac24 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.html +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html @@ -228,7 +228,7 @@
Despacho do Presidente da República
-Despachos criados por mim
+Despachos criados por mim
{{ despachoprstore.count }} Documentos
+
Presidente da República
+GABINETE DIGITAL
Presidente da República
+GABINETE DIGITAL
Calendário Partilhado
-Presidente República
+GABINETE DIGITAL