Ne uplne otestovany prepis storu
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
<script setup>
|
||||
import FlightsListSkeleton from "components/flights/FlightsListSkeleton.vue";
|
||||
import {event, events, fetchEvents, loading} from "src/composables/objects/event";
|
||||
import EventsList from "components/event/EventsList.vue";
|
||||
import {onMounted, watch} from "vue";
|
||||
import PublicFlightEventSwitcher from "components/navigation/PublicFlightEventSwitcher.vue";
|
||||
import {useAppStore} from "stores/App";
|
||||
import {useEventsStore} from "stores/Events";
|
||||
import {storeToRefs} from "pinia";
|
||||
|
||||
const props = defineProps({
|
||||
loggedUser: {
|
||||
@@ -28,20 +29,19 @@ onMounted(() => {
|
||||
{to: {name: "publicProfileDetail", params: {username: props.username}}, label: `@${props.username}`},
|
||||
{label: "Události"}
|
||||
]);
|
||||
fetchEvents(props.username);
|
||||
useEventsStore().fetch(props.username);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
const {isQueryRunning, events} = storeToRefs(useEventsStore());
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PublicFlightEventSwitcher :username="username"/>
|
||||
|
||||
<FlightsListSkeleton v-if="loading"/>
|
||||
<FlightsListSkeleton v-if="isQueryRunning"/>
|
||||
|
||||
|
||||
<q-banner class="bg-primary text-white" v-else-if="!loading && events.length === 0">
|
||||
<q-banner class="bg-primary text-white" v-else-if="!isQueryRunning && events.length === 0">
|
||||
Tento pilot zatím nepublikoval žádnou udalost.
|
||||
</q-banner>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user