mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -11,8 +11,12 @@ import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-pick
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
|
||||
<<<<<<< HEAD
|
||||
import { Directory, Filesystem } from '@capacitor/filesystem';
|
||||
|
||||
=======
|
||||
import { StorageService } from 'src/app/services/storage.service';
|
||||
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
|
||||
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
@@ -44,7 +48,11 @@ export class AppComponent {
|
||||
private screenOrientation: ScreenOrientation,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
private storageservice: StorageService
|
||||
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
|
||||
) {
|
||||
this.createCacheFolder()
|
||||
this.initializeApp();
|
||||
@@ -79,17 +87,15 @@ export class AppComponent {
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('online', () => {
|
||||
console.log('Became online')
|
||||
this.backgroundservice.online()
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
this.storageservice.get('networkCheckStore').then((network) => {
|
||||
if(network === 'online') {
|
||||
console.log('Network app componente check', network)
|
||||
this.backgroundservice.online()
|
||||
} else {
|
||||
console.log('Network app componente check', network)
|
||||
this.backgroundservice.offline();
|
||||
}
|
||||
});
|
||||
window.addEventListener('offline', () => {
|
||||
console.log('Became offline')
|
||||
this.backgroundservice.offline()
|
||||
});
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user