diff --git a/client/src/api/datatypes.ts b/client/src/api/datatypes.ts index 495019298f0..0cc5cb54ed4 100644 --- a/client/src/api/datatypes.ts +++ b/client/src/api/datatypes.ts @@ -1,5 +1,5 @@ -import { GalaxyApi } from "@/api"; import type { components } from "@/api"; +import { GalaxyApi } from "@/api"; import { rethrowSimple } from "@/utils/simple-error"; export type CompositeFileInfo = components["schemas"]["CompositeFileInfo"]; diff --git a/client/src/components/Dataset/DatasetView.vue b/client/src/components/Dataset/DatasetView.vue index 6c133971b21..85a9c5e1493 100644 --- a/client/src/components/Dataset/DatasetView.vue +++ b/client/src/components/Dataset/DatasetView.vue @@ -36,7 +36,15 @@ const iframeLoading = ref(true); const dataset = computed(() => datasetStore.getDataset(props.datasetId)); const headerState = computed(() => (headerCollapsed.value ? "closed" : "open")); -const isLoading = computed(() => datasetStore.isLoadingDataset(props.datasetId)); + +// Track datatype loading state +const isDatatypeLoading = ref(false); + +// Consolidated loading state +const isLoading = computed(() => { + return datasetStore.isLoadingDataset(props.datasetId) || isDatatypeLoading.value; +}); + const showError = computed( () => dataset.value && (dataset.value.state === "error" || dataset.value.state === "failed_metadata") ); @@ -47,20 +55,14 @@ const preferredVisualization = computed( () => dataset.value && datatypeStore.getPreferredVisualization(dataset.value.file_ext) ); -// Track datatype loading state -const isDatatypeLoading = ref(false); -const datatypeDetailsLoaded = ref(false); - // Watch for changes to the dataset to fetch datatype info watch( () => dataset.value?.file_ext, async () => { if (dataset.value && dataset.value.file_ext) { isDatatypeLoading.value = true; - datatypeDetailsLoaded.value = false; await datatypeStore.fetchDatatypeDetails(dataset.value.file_ext); isDatatypeLoading.value = false; - datatypeDetailsLoaded.value = true; } }, { immediate: true } @@ -68,7 +70,7 @@ watch(