Sql bug fixed

This commit is contained in:
Eudes Inácio
2021-10-18 07:44:24 +01:00
parent 3ae19356c0
commit 6ed724877e
11 changed files with 389 additions and 127 deletions
+36 -1
View File
@@ -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();
}