Hi, i have a service who checks if an internet connection is active:
serviceconnection
this.connected = this.network.onDisconnect().subscribe(() => {
console.log('you are offline');
this.presentConfirm();
});
this.disconnected = this.network.onConnect().subscribe(()=> {
console.log('you are online');
});
presentConfirm(){
let vm = this;
if(!vm.alertPresented) {
vm.alertPresented = true
vm.alertCtrl.create({
title: 'Advertencia',
subTitle: 'No internet',
enableBackdropDismiss: false,
buttons: [{
text: 'Reintentar',
handler: () => {
vm.alertPresented = false;
setTimeout(()=>{
if(this.checkConnection() == false){
this.presentConfirm();
}
}, 400);
}
}],
}).present();
}
}
If i have an opened object in another TS (for example an InAppBrowser window)… How can i close it if internet doesn’t exists?