Skip to content

Commit

Permalink
changed the NoParticipations view to only show up after loading is fi…
Browse files Browse the repository at this point in the history
…nisched
  • Loading branch information
Felix Ruf committed Oct 19, 2023
1 parent 5a5a898 commit 7310f10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Resources/src/api/getShowParticipations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const participationsState = reactive<IParticipationsState>({
});

/**
* State that contains wether the participationsState was successfully loaded, if not an error is set
* State that contains wether the participationsState was successfully loaded, if no error is set
*/
const loadedState = reactive<ILoadedState>({
loaded: false,
Expand All @@ -75,7 +75,7 @@ async function fetchParticipations() {

await request();
if (listData.value !== null && listData.value !== undefined && error.value === false) {
loadedState.error = "";
loadedState.error = '';
participationsState.data = listData.value.data;
participationsState.day = listData.value.day;
participationsState.meals = listData.value.meals;
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/src/views/ParticipantsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class="mx-auto"
/>
<NoParticipations
v-if="Object.entries(participationsState.meals).length === 0"
v-if="Object.entries(participationsState.meals).length === 0 && loadedState.loaded === true"
:day="participationsState.day"
/>
<MealOverview
Expand All @@ -34,7 +34,7 @@ import { useComponentHeights } from '@/services/useComponentHeights';
const progress = useProgress().start();
const { participationsState, loadShowParticipations, activatePeriodicFetch, disablePeriodicFetch } = getShowParticipations();
const { participationsState, loadShowParticipations, activatePeriodicFetch, disablePeriodicFetch, loadedState } = getShowParticipations();
const { addWindowHeightListener, removeWindowHeightListener } = useComponentHeights();
onMounted(async () => {
Expand Down

0 comments on commit 7310f10

Please sign in to comment.