2022-01-01 13:43:24 +01:00
|
|
|
import {ref} from 'vue'
|
2022-04-11 22:08:28 +02:00
|
|
|
import {useOnline as useNetworkOnline} from '@vueuse/core'
|
|
|
|
import type {ConfigurableWindow} from '@vueuse/core'
|
2022-01-01 13:43:24 +01:00
|
|
|
|
|
|
|
export function useOnline(options?: ConfigurableWindow) {
|
|
|
|
const fakeOnlineState = !!import.meta.env.VITE_IS_ONLINE
|
|
|
|
if (fakeOnlineState) {
|
|
|
|
console.log('Setting fake online state', fakeOnlineState)
|
|
|
|
}
|
|
|
|
|
|
|
|
return fakeOnlineState
|
|
|
|
? ref(true)
|
|
|
|
: useNetworkOnline(options)
|
|
|
|
}
|