fix: various fixes for versions (#5238)
* fix: environment not showing when has mod loaders * fix: weird snapshot format by only grouping consecutive tags with 3 or more * fix: 26.1 snapshots not grouped properly in mc version picker * remove debug console.log
This commit is contained in:
@@ -155,7 +155,7 @@ function groupVersions(gameVersions: GameVersion[]) {
|
|||||||
|
|
||||||
const groups: Record<string, string[]> = {}
|
const groups: Record<string, string[]> = {}
|
||||||
|
|
||||||
let currentGroupKey = getSnapshotGroupKey(gameVersions.find((v) => v.major)?.version || '')
|
let currentGroupKey
|
||||||
|
|
||||||
gameVersions.forEach((gameVersion) => {
|
gameVersions.forEach((gameVersion) => {
|
||||||
if (gameVersion.version_type === 'release') {
|
if (gameVersion.version_type === 'release') {
|
||||||
|
|||||||
@@ -426,9 +426,12 @@ export function createManageVersionContext(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Stage visibility computeds (inlined)
|
// Stage visibility computeds (inlined)
|
||||||
const noEnvironmentProject = computed(
|
const noEnvironmentProject = computed(() => {
|
||||||
() => projectType.value !== 'mod' && projectType.value !== 'modpack',
|
const hasModLoaders = draftVersion.value.loaders.some((loader) =>
|
||||||
)
|
PROJECT_TYPE_LOADERS.mod.includes(loader),
|
||||||
|
)
|
||||||
|
return !hasModLoaders && projectType.value !== 'modpack'
|
||||||
|
})
|
||||||
const noDependenciesProject = computed(() => projectType.value === 'modpack')
|
const noDependenciesProject = computed(() => projectType.value === 'modpack')
|
||||||
|
|
||||||
const getProject = async (projectId: string) => {
|
const getProject = async (projectId: string) => {
|
||||||
|
|||||||
@@ -126,12 +126,13 @@ export function formatVersionsForDisplay(
|
|||||||
|
|
||||||
// show all snapshots if there's no release versions
|
// show all snapshots if there's no release versions
|
||||||
if (releaseVersionsAsRanges.length === 0) {
|
if (releaseVersionsAsRanges.length === 0) {
|
||||||
const snapshotVersionsAsRanges = groupConsecutiveIndices(
|
const snapshotVersions = inputVersions.filter((projVer) =>
|
||||||
inputVersions.filter((projVer) =>
|
allSnapshots.some((gameVer) => gameVer.version === projVer),
|
||||||
allSnapshots.some((gameVer) => gameVer.version === projVer),
|
|
||||||
),
|
|
||||||
allSnapshots,
|
|
||||||
)
|
)
|
||||||
|
const snapshotVersionsAsRanges =
|
||||||
|
snapshotVersions.length > 3
|
||||||
|
? groupConsecutiveIndices(snapshotVersions, allSnapshots)
|
||||||
|
: snapshotVersions
|
||||||
output = [...snapshotVersionsAsRanges, ...output]
|
output = [...snapshotVersionsAsRanges, ...output]
|
||||||
} else {
|
} else {
|
||||||
output = [...releaseVersionsAsRanges, ...output]
|
output = [...releaseVersionsAsRanges, ...output]
|
||||||
|
|||||||
Reference in New Issue
Block a user