mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
Sql bug fixed
This commit is contained in:
@@ -22,6 +22,9 @@ import { DocumentCounterService } from '../services/worker/document-counter.serv
|
||||
import { PermissionService } from '../services/worker/permission.service';
|
||||
import { Network } from '@ionic-native/network/ngx';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { OfflineManagerService } from 'src/app/services/offline-manager.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { EventsService} from 'src/app/services/events.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -82,7 +85,10 @@ export class HomePage implements OnInit {
|
||||
private storageService: StorageService,
|
||||
private webNotificationPopupService: WebNotificationPopupService,
|
||||
private network: Network,
|
||||
private backgroundservice: BackgroundService) {
|
||||
private backgroundservice: BackgroundService,
|
||||
private offlinemanager: OfflineManagerService,
|
||||
private storage: Storage,
|
||||
private eventservice: EventsService ) {
|
||||
|
||||
this.webNotificationPopupService.askNotificationPermission()
|
||||
|
||||
@@ -124,6 +130,35 @@ export class HomePage implements OnInit {
|
||||
this.webnotification.webconnection();
|
||||
this.webnotification.register();
|
||||
} else {
|
||||
window.addEventListener('online', (on) => {
|
||||
console.log('Became online',on)
|
||||
this.storage.get('storedreq').then((req) =>{
|
||||
console.log('STORED REQUEST', req)
|
||||
req.forEach(element => {
|
||||
this.eventservice.editEvent(element,2,3).subscribe((res) =>{
|
||||
console.log('REQUEST RESULT', res)
|
||||
})
|
||||
});
|
||||
|
||||
})
|
||||
this.backgroundservice.online()
|
||||
});
|
||||
window.addEventListener('offline', (off) => {
|
||||
console.log('Became offline',off)
|
||||
this.backgroundservice.offline()
|
||||
});
|
||||
if(synchro.connected === true) {
|
||||
//this.offlinemanager.checkForEvents().subscribe();
|
||||
this.storage.get('storedreq').then((req) =>{
|
||||
console.log('STORED REQUEST', req)
|
||||
req.forEach(element => {
|
||||
this.eventservice.editEvent(element,2,3).subscribe((res) =>{
|
||||
console.log('REQUEST RESULT', res)
|
||||
})
|
||||
});
|
||||
|
||||
})
|
||||
}
|
||||
this.mobilefirstConnect();
|
||||
this.notificationsService.onReceviNotification();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user