Prevent people from selecting unknown environment (#775)

This commit is contained in:
triphora
2022-11-26 13:35:13 -05:00
committed by GitHub
parent 63035196af
commit e5ae1db49c
2 changed files with 36 additions and 3 deletions

View File

@@ -115,6 +115,26 @@ export default {
getProjectType() {
return this.$tag.projectTypes.find((x) => this.projectType === x.display)
},
getClientSide() {
switch (this.getProjectType().id) {
case 'plugin':
return 'unsupported'
case 'resourcepack':
return 'required'
default:
return 'unknown'
}
},
getServerSide() {
switch (this.getProjectType().id) {
case 'plugin':
return 'required'
case 'resourcepack':
return 'unsupported'
default:
return 'unknown'
}
},
async createProject() {
this.$nuxt.$loading.start()
@@ -159,8 +179,8 @@ Questions? [Join the Modrinth Discord for support!](https://discord.gg/EUHuJHt)`
},
],
categories: [],
client_side: 'unknown',
server_side: 'unknown',
client_side: this.getClientSide(),
server_side: this.getServerSide(),
license_id: this.$tag.licenses.map((it) => it.short).includes('arr')
? 'arr'
: this.$tag.licenses[0].short,