forked from vikunja/frontend
Co-authored-by: Dominik Pschenitschni <mail@celement.de> Reviewed-on: vikunja/frontend#2924 Co-authored-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de> Co-committed-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
13 lines
449 B
TypeScript
13 lines
449 B
TypeScript
import {ref} from 'vue'
|
|
import {useOnline as useNetworkOnline} from '@vueuse/core'
|
|
import type {ConfigurableWindow} from '@vueuse/core'
|
|
|
|
export function useOnline(options?: ConfigurableWindow) {
|
|
const isOnline = useNetworkOnline(options)
|
|
const fakeOnlineState = !!import.meta.env.VITE_IS_ONLINE
|
|
if (isOnline.value === false && fakeOnlineState) {
|
|
console.log('Setting fake online state', fakeOnlineState)
|
|
return ref(true)
|
|
}
|
|
return isOnline
|
|
} |