Some checks failed
ci / ci (22, ubuntu-latest) (push) Has been cancelled
Nuxt 4 + Supabase + Flightics API. Incluye búsqueda de vuelos, inspiraciones, watchlist, tracking de precios y mapa interactivo. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
19 lines
569 B
TypeScript
19 lines
569 B
TypeScript
export function useOriginTime() {
|
|
const cookie = useCookie('showOriginTime', { default: () => false, watch: true })
|
|
const { profile, updateProfile } = useUserPreferences()
|
|
const user = useSupabaseUser()
|
|
|
|
const showOriginTime = computed({
|
|
get: () => user.value && profile.value ? profile.value.show_origin_time : cookie.value,
|
|
set: (v: boolean) => {
|
|
cookie.value = v
|
|
if (user.value && profile.value) {
|
|
profile.value.show_origin_time = v
|
|
updateProfile({ show_origin_time: v })
|
|
}
|
|
}
|
|
})
|
|
|
|
return { showOriginTime }
|
|
}
|