From 1dc6e085cc72eb84089483a78b1c010122cb43e6 Mon Sep 17 00:00:00 2001 From: Redblueflame Date: Tue, 30 Mar 2021 18:02:26 +0200 Subject: [PATCH] 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 --- package-lock.json | 1 - pages/mods.vue | 11 ++++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 35bd2d1cd..63b509903 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,7 +5,6 @@ "requires": true, "packages": { "": { - "name": "knossos", "version": "1.0.0", "dependencies": { "@nuxtjs/axios": "^5.12.5", diff --git a/pages/mods.vue b/pages/mods.vue index 91d5d3b98..054488951 100644 --- a/pages/mods.vue +++ b/pages/mods.vue @@ -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) {