mirror of
https://github.com/modrinth/code.git
synced 2026-07-31 13:16:38 +00:00
fix: download modal suggested dep can use wrong mc version (#6925)
This commit is contained in:
@@ -86,10 +86,17 @@ export function provideDownloadModalProvider(
|
|||||||
const tags = useGeneratedState()
|
const tags = useGeneratedState()
|
||||||
|
|
||||||
const shouldResolveDependencies = computed(
|
const shouldResolveDependencies = computed(
|
||||||
() => !!options.project.value && !!options.selectedVersion.value,
|
() =>
|
||||||
|
!!options.project.value &&
|
||||||
|
!!options.selectedVersion.value &&
|
||||||
|
!!options.currentGameVersion.value,
|
||||||
)
|
)
|
||||||
const dependencyResolutionPreferences = computed(() =>
|
const dependencyResolutionPreferences = computed(() =>
|
||||||
createResolutionPreferences(options.selectedVersion.value, options.currentPlatform.value),
|
createResolutionPreferences(
|
||||||
|
options.selectedVersion.value,
|
||||||
|
options.currentGameVersion.value,
|
||||||
|
options.currentPlatform.value,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
const { data: dependencyResolution, isFetching: dependencyResolutionFetching } = useQuery({
|
const { data: dependencyResolution, isFetching: dependencyResolutionFetching } = useQuery({
|
||||||
@@ -309,10 +316,12 @@ export function provideDownloadModalProvider(
|
|||||||
})
|
})
|
||||||
|
|
||||||
async function preloadDependenciesForSelection(selection: ProjectDownloadSelection) {
|
async function preloadDependenciesForSelection(selection: ProjectDownloadSelection) {
|
||||||
if (!options.project.value || !selection.selectedVersion) return
|
if (!options.project.value || !selection.selectedVersion || !selection.currentGameVersion)
|
||||||
|
return
|
||||||
|
|
||||||
const preferences = createResolutionPreferences(
|
const preferences = createResolutionPreferences(
|
||||||
selection.selectedVersion,
|
selection.selectedVersion,
|
||||||
|
selection.currentGameVersion,
|
||||||
selection.currentPlatform,
|
selection.currentPlatform,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -548,10 +557,11 @@ function dependencyProjectsQueryOptions(
|
|||||||
|
|
||||||
function createResolutionPreferences(
|
function createResolutionPreferences(
|
||||||
version: Labrinth.Versions.v3.Version | null,
|
version: Labrinth.Versions.v3.Version | null,
|
||||||
|
currentGameVersion: string | null,
|
||||||
currentPlatform: string | null,
|
currentPlatform: string | null,
|
||||||
): Labrinth.Content.v3.ResolutionPreferences {
|
): Labrinth.Content.v3.ResolutionPreferences {
|
||||||
return {
|
return {
|
||||||
game_versions: version?.game_versions || [],
|
game_versions: currentGameVersion ? [currentGameVersion] : [],
|
||||||
loaders: currentPlatform ? [currentPlatform] : version?.loaders || [],
|
loaders: currentPlatform ? [currentPlatform] : version?.loaders || [],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user