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:
@@ -9,6 +9,7 @@ import { NgxMatDateFormats } from '@angular-material-components/datetime-picker'
|
||||
const moment = _rollupMoment || _moment;
|
||||
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
|
||||
|
||||
|
||||
@@ -39,7 +40,8 @@ export class AppComponent {
|
||||
/* private splashScreen: SplashScreen, */
|
||||
private statusBar: StatusBar,
|
||||
private screenOrientation: ScreenOrientation,
|
||||
private sqliteservice: SqliteService
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService
|
||||
) {
|
||||
this.initializeApp();
|
||||
}
|
||||
@@ -65,6 +67,18 @@ export class AppComponent {
|
||||
console.log("Error creating local database: ", error)
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('online', () => {
|
||||
console.log('Became online')
|
||||
this.backgroundservice.online()
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
}
|
||||
});
|
||||
window.addEventListener('offline', () => {
|
||||
console.log('Became offline')
|
||||
this.backgroundservice.offline()
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user