Updated logo API
This commit is contained in:
@@ -17,11 +17,12 @@ const props = defineProps<{
|
||||
user: User
|
||||
flights: Flight[]
|
||||
canEdit: boolean
|
||||
selectedFlightId: number | null
|
||||
selectedFlightId?: number | null
|
||||
initialView?: ProfileView
|
||||
isFollowing: boolean
|
||||
}>()
|
||||
|
||||
const localSelectedFlightId = ref(props.selectedFlightId)
|
||||
const localSelectedFlightId = ref(props.selectedFlightId ?? null)
|
||||
|
||||
// ── Filter state ──────────────────────────────────────────────────────────────
|
||||
const selectedYears = ref<number[]>([])
|
||||
@@ -69,9 +70,7 @@ function matchesFilters(f: Flight): boolean {
|
||||
}
|
||||
|
||||
const filteredFlights = computed(() => {
|
||||
console.time('filteredFlights')
|
||||
const result = props.flights.filter(matchesFilters)
|
||||
console.timeEnd('filteredFlights')
|
||||
return result
|
||||
})
|
||||
|
||||
@@ -100,19 +99,23 @@ const routeNames = {
|
||||
} as const
|
||||
|
||||
function switchView(view: ProfileView) {
|
||||
const flightId = view === 'board' ? localSelectedFlightId.value : null
|
||||
localSelectedFlightId.value = null
|
||||
activeView.value = view
|
||||
window.history.replaceState(
|
||||
window.history.state,
|
||||
'',
|
||||
route(routeNames[view], { username: props.user.name })
|
||||
route(routeNames[view], {
|
||||
user: props.user.name,
|
||||
...(flightId ? { flight: flightId } : {})
|
||||
})
|
||||
)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Head :title="`${user.name}'s Flights`" />
|
||||
<ProfileLayout :flights="flights" :user="user">
|
||||
<ProfileLayout :is-following="isFollowing" :flights="flights" :user="user">
|
||||
<ProfileViewSwitcher :active-view="activeView" @update:active-view="switchView" />
|
||||
<DepartureBoard v-if="activeView === 'board'" :flight-id="localSelectedFlightId" :flight-stats="stats" :canEdit="canEdit" />
|
||||
<BoardingPasses v-if="activeView === 'passes'" :flight-stats="stats" :canEdit="canEdit" />
|
||||
|
||||
Reference in New Issue
Block a user