You've already forked AstralRinth
forked from didirus/AstralRinth
Prevent people from selecting unknown environment (#775)
This commit is contained in:
@@ -115,6 +115,26 @@ export default {
|
|||||||
getProjectType() {
|
getProjectType() {
|
||||||
return this.$tag.projectTypes.find((x) => this.projectType === x.display)
|
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() {
|
async createProject() {
|
||||||
this.$nuxt.$loading.start()
|
this.$nuxt.$loading.start()
|
||||||
|
|
||||||
@@ -159,8 +179,8 @@ Questions? [Join the Modrinth Discord for support!](https://discord.gg/EUHuJHt)`
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
categories: [],
|
categories: [],
|
||||||
client_side: 'unknown',
|
client_side: this.getClientSide(),
|
||||||
server_side: 'unknown',
|
server_side: this.getServerSide(),
|
||||||
license_id: this.$tag.licenses.map((it) => it.short).includes('arr')
|
license_id: this.$tag.licenses.map((it) => it.short).includes('arr')
|
||||||
? 'arr'
|
? 'arr'
|
||||||
: this.$tag.licenses[0].short,
|
: this.$tag.licenses[0].short,
|
||||||
|
|||||||
@@ -267,6 +267,14 @@
|
|||||||
Your project must have at least one version to submit for
|
Your project must have at least one version to submit for
|
||||||
review.
|
review.
|
||||||
</li>
|
</li>
|
||||||
|
<li
|
||||||
|
v-if="
|
||||||
|
project.client_side === 'unknown' ||
|
||||||
|
project.server_side === 'unknown'
|
||||||
|
"
|
||||||
|
>
|
||||||
|
Your project must have the supported environments selected.
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1155,7 +1163,12 @@ export default {
|
|||||||
this.$nuxt.$loading.finish()
|
this.$nuxt.$loading.finish()
|
||||||
},
|
},
|
||||||
async submitForReview() {
|
async submitForReview() {
|
||||||
if (this.project.body === '' || this.project.versions.length < 1) {
|
if (
|
||||||
|
this.project.body === '' ||
|
||||||
|
this.project.versions.length < 1 ||
|
||||||
|
this.project.client_side === 'unknown' ||
|
||||||
|
this.project.server_side === 'unknown'
|
||||||
|
) {
|
||||||
this.showKnownErrors = true
|
this.showKnownErrors = true
|
||||||
} else {
|
} else {
|
||||||
this.$nuxt.$loading.start()
|
this.$nuxt.$loading.start()
|
||||||
|
|||||||
Reference in New Issue
Block a user