fix: loading causing stale data to present in form(#650)

Former-commit-id: 4d9131ba7e
This commit is contained in:
Hayden 2023-12-01 11:57:43 -06:00 committed by GitHub
parent 81e76d9dd4
commit fc3bc3f010
1 changed files with 6 additions and 2 deletions

View File

@ -23,7 +23,11 @@
const labelStore = useLabelStore();
const labels = computed(() => labelStore.labels);
const { data: nullableItem, refresh } = useAsyncData(async () => {
const {
data: nullableItem,
refresh,
pending: requestPending,
} = useAsyncData(async () => {
const { data, error } = await api.items.get(itemId.value);
if (error) {
toast.error("Failed to load item");
@ -450,7 +454,7 @@
Delete
</BaseButton>
</div>
<div class="space-y-6">
<div v-if="!requestPending" class="space-y-6">
<BaseCard class="overflow-visible">
<template #title> Edit Details </template>
<template #title-actions>