Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,14 @@ const creatingInstance = ref(false)
const profiles = ref([])

const shownProfiles = computed(() =>
profiles.value
.filter((profile) => {
return profile.name.toLowerCase().includes(searchFilter.value.toLowerCase())
})
.filter((profile) => {
const version = {
game_versions: versions.value.flatMap((v) => v.game_versions),
loaders: versions.value.flatMap((v) => v.loaders),
}
return isVersionCompatible(version, project.value, profile)
}),
profiles.value.filter((profile) => {
return profile.name.toLowerCase().includes(searchFilter.value.toLowerCase())
}),
)

const isProfileCompatible = (profile) =>
versions.value?.some((version) => isVersionCompatible(version, project.value, profile))

const onInstall = ref(() => {})

defineExpose({
Expand Down Expand Up @@ -164,13 +159,13 @@ const createInstance = async () => {
const gameVersion = gameVersions[0]

const loaders = versions.value[0].loaders
const loader = loaders.contains('fabric')
const loader = loaders.includes('fabric')
? 'fabric'
: loaders.contains('neoforge')
: loaders.includes('neoforge')
? 'neoforge'
: loaders.contains('forge')
: loaders.includes('forge')
? 'forge'
: loaders.contains('quilt')
: loaders.includes('quilt')
? 'quilt'
: 'vanilla'

Expand Down Expand Up @@ -240,17 +235,23 @@ const createInstance = async () => {
"
>
<Button
:disabled="profile.installedMod || profile.installing"
:disabled="
!isProfileCompatible(profile) || profile.installedMod || profile.installing
"
@click="install(profile)"
>
<DownloadIcon v-if="!profile.installedMod && !profile.installing" />
<DownloadIcon
v-if="isProfileCompatible(profile) && !profile.installedMod && !profile.installing"
/>
<CheckIcon v-else-if="profile.installedMod" />
{{
profile.installing
? 'Installing...'
: profile.installedMod
? 'Installed'
: 'Install'
: !isProfileCompatible(profile)
? 'Incompatible'
: 'Install'
}}
</Button>
</div>
Expand Down