22 lines
569 B
TypeScript
22 lines
569 B
TypeScript
import { onMounted, ref } from 'vue'
|
|||
|
|
import { fetchTrackingSettings, isTrackingSystemsEnabled } from '@/utils/trackingSystemsSettings'
|
||
|
|
|
||
|
|
export function useTrackingSystemsFeature() {
|
||
|
|
const trackingSystemsEnabled = ref(false)
|
||
|
|
const trackingSystemsReady = ref(false)
|
||
|
|
|
||
|
|
onMounted(async () => {
|
||
|
|
try {
|
||
|
|
const settings = await fetchTrackingSettings()
|
||
|
|
trackingSystemsEnabled.value = isTrackingSystemsEnabled(settings)
|
||
|
|
} finally {
|
||
|
|
trackingSystemsReady.value = true
|
||
|
|
}
|
||
|
|
})
|
||
|
|
|
||
|
|
return {
|
||
|
|
trackingSystemsEnabled,
|
||
|
|
trackingSystemsReady,
|
||
|
|
}
|
||
|
|
}
|