You've already forked AstralRinth
forked from didirus/AstralRinth
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:
1
package-lock.json
generated
1
package-lock.json
generated
@@ -5,7 +5,6 @@
|
|||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "knossos",
|
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxtjs/axios": "^5.12.5",
|
"@nuxtjs/axios": "^5.12.5",
|
||||||
|
|||||||
@@ -439,9 +439,18 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async fillInitialLicenses() {
|
async fillInitialLicenses() {
|
||||||
this.licenses = (
|
const licences = (
|
||||||
await axios.get('https://api.modrinth.com/api/v1/tag/license')
|
await axios.get('https://api.modrinth.com/api/v1/tag/license')
|
||||||
).data
|
).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) {
|
async toggleLicense(license) {
|
||||||
if (this.selectedLicense) {
|
if (this.selectedLicense) {
|
||||||
|
|||||||
Reference in New Issue
Block a user