fix: version showing before depedencies loaded

This commit is contained in:
tdgao
2026-07-07 14:16:32 -07:00
parent e199bddcfb
commit 57932be477
3 changed files with 10 additions and 13 deletions
@@ -34,7 +34,7 @@ defineOptions({
name: 'DownloadDependencies',
})
const props = withDefaults(
withDefaults(
defineProps<{
showTitle?: boolean
}>(),
@@ -104,7 +104,9 @@
:current-platform="currentPlatform"
:selectable="compatibleVersions.length > 1"
:selected="compatibleVersion.id === selectedVersion.id"
:show-download="compatibleVersions.length === 1 || compatibleVersion.id === selectedVersion.id"
:show-download="
compatibleVersions.length === 1 || compatibleVersion.id === selectedVersion.id
"
:color="
compatibleVersion.id === selectedVersion.id &&
compatibleVersions.length === 1 &&
@@ -381,7 +383,8 @@ const defaultSelectedVersion = computed<Labrinth.Versions.v3.Version | null>(()
})
const suggestedPreReleaseVersions = computed<Labrinth.Versions.v3.Version[]>(() => {
if (!defaultSelectedVersion.value || defaultSelectedVersion.value.version_type !== 'release') return []
if (!defaultSelectedVersion.value || defaultSelectedVersion.value.version_type !== 'release')
return []
const versions: Labrinth.Versions.v3.Version[] = []
const beta = filteredBeta.value
@@ -19,7 +19,7 @@
:project="project"
:versions="versions"
:dependency-download-files="dependencyDownloadFiles"
:download-data-loaded="selectedVersionDownloadLoaded"
:download-data-loaded="downloadRowsLoaded"
:download-reason="downloadReason"
:initial-game-version="initialGameVersion"
:initial-platform="initialPlatform"
@@ -280,7 +280,7 @@ const downloadModalProvider = provideDownloadModalProvider({
})
const dependencyDownloadFiles = downloadModalProvider.downloadableDependencyFiles
const dependencyDownloadFilesLoaded = downloadModalProvider.downloadableDependencyFilesLoaded
const selectedVersionDownloadLoaded = computed(() => !!selectedPrimaryFile.value)
const downloadRowsLoaded = downloadModalProvider.downloadRowsLoaded
const selectedVersionDownloadFiles = computed<DownloadableFile[]>(() => {
if (!selectedVersion.value) return []
@@ -731,8 +731,7 @@ function getRouteSelectedDownloadSelection(
const gameVersion = initialGameVersion.value
const platform = initialPlatform.value
const version = getSelectedRouteVersion(gameVersion, platform, versionList)
const primaryFile =
version?.files?.find((file) => file.primary) || version?.files?.[0] || null
const primaryFile = version?.files?.find((file) => file.primary) || version?.files?.[0] || null
if (!gameVersion || !platform || !version || !primaryFile) return null
@@ -808,12 +807,7 @@ async function preloadDependenciesForSelection(selection: ProjectDownloadSelecti
}
function isActiveShowRequest(showRequestId: number) {
return (
!unmounted &&
modalShowRequestId === showRequestId &&
!!modal.value &&
!modalOpen.value
)
return !unmounted && modalShowRequestId === showRequestId && !!modal.value && !modalOpen.value
}
function resetDownloadState() {