vikunja-frontend/src/composables/useOnline.ts
Dominik Pschenitschni d064f0acc0 fix import type
2022-07-04 21:50:48 +00:00

14 lines
No EOL
410 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 fakeOnlineState = !!import.meta.env.VITE_IS_ONLINE
if (fakeOnlineState) {
console.log('Setting fake online state', fakeOnlineState)
}
return fakeOnlineState
? ref(true)
: useNetworkOnline(options)
}