mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Offline background color bug fix on init app
This commit is contained in:
+10
-10
@@ -11,6 +11,7 @@ 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';
|
||||
import { StorageService } from 'src/app/services/storage.service';
|
||||
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
@@ -41,7 +42,8 @@ export class AppComponent {
|
||||
private statusBar: StatusBar,
|
||||
private screenOrientation: ScreenOrientation,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService
|
||||
private backgroundservice: BackgroundService,
|
||||
private storageservice: StorageService
|
||||
) {
|
||||
this.initializeApp();
|
||||
}
|
||||
@@ -68,17 +70,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