From: Benjamin Auder Date: Sat, 22 Feb 2020 13:01:19 +0000 (+0100) Subject: Sort variants alphabetically X-Git-Url: https://git.auder.net/variants/current/doc/DESCRIPTION?a=commitdiff_plain;h=e9b0b5043dc87ebc6857c255e2202a215912c4d9;p=vchess.git Sort variants alphabetically --- diff --git a/client/src/store.js b/client/src/store.js index 91f9bdd8..e7e86971 100644 --- a/client/src/store.js +++ b/client/src/store.js @@ -13,7 +13,8 @@ export const store = { socketCloseListener: null, initialize() { ajax("/variants", "GET", res => { - this.state.variants = res.variantArray.sort((v1,v2) => v1.localeCompare(v2)); + this.state.variants = res.variantArray.sort( + (v1,v2) => v1.name.localeCompare(v2.name)); }); let mysid = localStorage.getItem("mysid"); // Assign mysid only once (until next time user clear browser data)