Skip to content

Commit 747c6d0

Browse files
committed
Consolidate loading states, fix API imports.
1 parent 0648cbe commit 747c6d0

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

client/src/api/datatypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { GalaxyApi } from "@/api";
21
import type { components } from "@/api";
2+
import { GalaxyApi } from "@/api";
33
import { rethrowSimple } from "@/utils/simple-error";
44

55
export type CompositeFileInfo = components["schemas"]["CompositeFileInfo"];

client/src/components/Dataset/DatasetView.vue

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,15 @@ const iframeLoading = ref(true);
3636
3737
const dataset = computed(() => datasetStore.getDataset(props.datasetId));
3838
const headerState = computed(() => (headerCollapsed.value ? "closed" : "open"));
39-
const isLoading = computed(() => datasetStore.isLoadingDataset(props.datasetId));
39+
40+
// Track datatype loading state
41+
const isDatatypeLoading = ref(false);
42+
43+
// Consolidated loading state
44+
const isLoading = computed(() => {
45+
return datasetStore.isLoadingDataset(props.datasetId) || isDatatypeLoading.value;
46+
});
47+
4048
const showError = computed(
4149
() => dataset.value && (dataset.value.state === "error" || dataset.value.state === "failed_metadata")
4250
);
@@ -47,28 +55,22 @@ const preferredVisualization = computed(
4755
() => dataset.value && datatypeStore.getPreferredVisualization(dataset.value.file_ext)
4856
);
4957
50-
// Track datatype loading state
51-
const isDatatypeLoading = ref(false);
52-
const datatypeDetailsLoaded = ref(false);
53-
5458
// Watch for changes to the dataset to fetch datatype info
5559
watch(
5660
() => dataset.value?.file_ext,
5761
async () => {
5862
if (dataset.value && dataset.value.file_ext) {
5963
isDatatypeLoading.value = true;
60-
datatypeDetailsLoaded.value = false;
6164
await datatypeStore.fetchDatatypeDetails(dataset.value.file_ext);
6265
isDatatypeLoading.value = false;
63-
datatypeDetailsLoaded.value = true;
6466
}
6567
},
6668
{ immediate: true }
6769
);
6870
</script>
6971

7072
<template>
71-
<LoadingSpan v-if="isLoading || !dataset || isDatatypeLoading" message="Loading dataset details" />
73+
<LoadingSpan v-if="isLoading || !dataset" message="Loading dataset details" />
7274
<div v-else class="dataset-view d-flex flex-column h-100">
7375
<header :key="`dataset-header-${dataset.id}`" class="dataset-header flex-shrink-0">
7476
<div class="d-flex">

0 commit comments

Comments
 (0)