From 4ff3dcb3fe11ff9da27970190060710ed0d78cb4 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Wed, 16 Jul 2025 18:59:11 +0200 Subject: [PATCH] Remove use of async components When async components are added dynamically to the tree via v-for list that change their order and position gets messed up. I am not sure what causes this, so I will just work around the issue for now and not use async components. Components that need async data loaded will instead depend on the parent page fetching this data during its setup. --- components/AssignedCrew.vue | 1 - components/CardEvent.vue | 1 - components/CardShift.vue | 2 -- components/TableScheduleEventSlots.vue | 1 - components/TableScheduleShiftSlots.vue | 1 - components/TableUsers.vue | 1 - 6 files changed, 7 deletions(-) diff --git a/components/AssignedCrew.vue b/components/AssignedCrew.vue index bc0cd61..481dd67 100644 --- a/components/AssignedCrew.vue +++ b/components/AssignedCrew.vue @@ -29,7 +29,6 @@ defineProps<{ edit?: boolean }>(); const usersStore = useUsersStore(); -await usersStore.fetch(); const assignedIds = defineModel>({ required: true }); const assigned = computed( () => [...assignedIds.value].map( diff --git a/components/CardEvent.vue b/components/CardEvent.vue index 1a81b64..11feb85 100644 --- a/components/CardEvent.vue +++ b/components/CardEvent.vue @@ -53,7 +53,6 @@ defineProps<{ const accountStore = useAccountStore(); const usersStore = useUsersStore(); -await usersStore.fetch(); function formatTime(time: DateTime) { return time.toFormat("yyyy-LL-dd HH:mm"); diff --git a/components/CardShift.vue b/components/CardShift.vue index a65210e..ac5c4e9 100644 --- a/components/CardShift.vue +++ b/components/CardShift.vue @@ -27,9 +27,7 @@ defineProps<{ shift: ClientScheduleShift }>() -const accountStore = useAccountStore(); const usersStore = useUsersStore(); -await usersStore.fetch(); function formatTime(time: DateTime) { return time.toFormat("yyyy-LL-dd HH:mm"); diff --git a/components/TableScheduleEventSlots.vue b/components/TableScheduleEventSlots.vue index f7a9916..5661865 100644 --- a/components/TableScheduleEventSlots.vue +++ b/components/TableScheduleEventSlots.vue @@ -215,7 +215,6 @@ interface Gap { const accountStore = useAccountStore(); const usersStore = useUsersStore(); -await usersStore.fetch(); const schedule = await useSchedule(); const oneDayMs = 24 * 60 * 60 * 1000; diff --git a/components/TableScheduleShiftSlots.vue b/components/TableScheduleShiftSlots.vue index 0369a6c..a2e745e 100644 --- a/components/TableScheduleShiftSlots.vue +++ b/components/TableScheduleShiftSlots.vue @@ -209,7 +209,6 @@ interface Gap { const accountStore = useAccountStore(); const usersStore = useUsersStore(); -await usersStore.fetch(); const schedule = await useSchedule(); const oneDayMs = 24 * 60 * 60 * 1000; diff --git a/components/TableUsers.vue b/components/TableUsers.vue index af76875..7e8d006 100644 --- a/components/TableUsers.vue +++ b/components/TableUsers.vue @@ -55,7 +55,6 @@