license import { hideOverlay , showOverlay } from '../elements/overlay/overlay.js' ; /**
 * Handles connectivity change for the user.
 */ function onConnectivityChanged ( ) { if ( ! navigator . onLine ) { showOverlay ( 'Currently offline. Please reconnect to the network.' ) ; } else { hideOverlay ( ) ; } } export function observeConnectivityChanges ( ) { window . addEventListener ( 'offline' , onConnectivityChanged ) ; window . addEventListener ( 'online' , onConnectivityChanged ) ; } export function unobserveConnectivityChanges ( ) { window . removeEventListener ( 'offline' , onConnectivityChanged ) ; window . removeEventListener ( 'online' , onConnectivityChanged ) ; }