diff --git a/apps/frontend/src/components/ui/ProjectDownloadModal/DownloadProject.vue b/apps/frontend/src/components/ui/ProjectDownloadModal/DownloadProject.vue index 9ede36219f..9294a1fd37 100644 --- a/apps/frontend/src/components/ui/ProjectDownloadModal/DownloadProject.vue +++ b/apps/frontend/src/components/ui/ProjectDownloadModal/DownloadProject.vue @@ -374,6 +374,7 @@ function selectGameVersion(gameVersion?: string) { if (!gameVersion) return userSelectedGameVersion.value = gameVersion emit('selectGameVersion', gameVersion) + selectOnlyCompatiblePlatform() } function selectPlatform(platform?: string) { @@ -421,6 +422,18 @@ function isPlatformUnavailable(platform: string) { return incompatibleLoadersSet.value.has(platform) || !possiblePlatforms.value.includes(platform) } +function selectOnlyCompatiblePlatform() { + const compatiblePlatforms = props.project.loaders.filter( + (platform) => + possiblePlatforms.value.includes(platform) && !incompatibleLoadersSet.value.has(platform), + ) + + if (compatiblePlatforms.length !== 1) return + + userSelectedPlatform.value = compatiblePlatforms[0] + emit('selectPlatform', compatiblePlatforms[0]) +} + function gameVersionOptionTooltip(gameVersion: string) { if (incompatibleGameVersionsSet.value.has(gameVersion)) { return formatMessage(messages.baseGameVersionIncompatibleTooltip)