I want to put in this kind of code is user connected to network or not. If is connected to do this then blocks or if its NOT connected to do something other, such as get data from local storage. I'm confused how to do that.
getStorageWarents() {
this.storage.ready()
.then(() => {
this.warrentsInStorage = JSON.parse(localStorage.getItem('__mydb/_ionickv/DodNalog'));
console.log("Warrents in storage: ", this.warrentsInStorage);
})
.then(() => {
this.getAssignedWarrents();
})
.then(() => {
this.getAllGoods();
})
.then(() => {
this.getAllCancelTypes();
})
.then(() => {
this.getAllDeviceTypes();
})
.then(() => {
this.getAllManufacturers();
})
.then(() => {
this.getAllIntereventionTypes();
})
}