Ordered the licences in alphabetical order, and put custom at the bottom (#134)

* Ordered the licences in alphabetical order, and put custom at the bottom.

* Fixed package-lock.json version change
This commit is contained in:
Redblueflame
2021-03-30 18:02:26 +02:00
committed by GitHub
parent 8594ff0c23
commit 1dc6e085cc
2 changed files with 10 additions and 2 deletions

1
package-lock.json generated
View File

@@ -5,7 +5,6 @@
"requires": true,
"packages": {
"": {
"name": "knossos",
"version": "1.0.0",
"dependencies": {
"@nuxtjs/axios": "^5.12.5",

View File

@@ -439,9 +439,18 @@ export default {
}
},
async fillInitialLicenses() {
this.licenses = (
const licences = (
await axios.get('https://api.modrinth.com/api/v1/tag/license')
).data
licences.sort((x, y) => {
// Custom case for custom, so it goes to the bottom of the list.
if (x.short === 'custom') return 1
if (y.short === 'custom') return -1
if (x.name < y.name) return -1
if (x.name > y.name) return 1
return 0
})
this.licenses = licences
},
async toggleLicense(license) {
if (this.selectedLicense) {