Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
13 lines
420 B
Plaintext
13 lines
420 B
Plaintext
/**
|
|
* Assumes a browser is online if `undefined`, otherwise makes a best effort
|
|
* @link https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine/onLine
|
|
*/
|
|
export function isOnline() {
|
|
// We set the default config value in the store, so we'd need to check for this in a SSR env
|
|
return typeof navigator === 'undefined'
|
|
? true
|
|
: navigator.onLine === undefined
|
|
? true
|
|
: navigator.onLine
|
|
}
|