Initial commit: Vuelato - buscador de vuelos
Some checks failed
ci / ci (22, ubuntu-latest) (push) Has been cancelled
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>
This commit is contained in:
18
app/composables/useOriginTime.ts
Normal file
18
app/composables/useOriginTime.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
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 }
|
||||
}
|
||||
Reference in New Issue
Block a user