My application only work with online so if user logged in with network and turn off i need to show offline message and again if user turned on network i need to reload current page. Please suggest how to achieve this functionality on framework 7 v2.
thats the code i use for detecting online/offline status
function updateIndicator() {
if(navigator.onLine){
offlinePopup.close();
app.view.current.router.refreshPage();
} else {
offlinePopup.open();
}
}
// Update the online status icon based on connectivity
window.addEventListener('online', updateIndicator);
window.addEventListener('offline', updateIndicator);