From: Benjamin Auder Date: Sat, 22 Feb 2020 13:00:18 +0000 (+0100) Subject: Sort variants alphabetically X-Git-Url: https://git.auder.net/%7B%7B%20path%28%27mixstore_store_usecase_upsert%27%29%20%7D%7D?a=commitdiff_plain;h=f920250230b564373911c895f18a57ab464be937;p=vchess.git Sort variants alphabetically --- diff --git a/client/src/store.js b/client/src/store.js index 60e01b97..91f9bdd8 100644 --- a/client/src/store.js +++ b/client/src/store.js @@ -13,7 +13,7 @@ export const store = { socketCloseListener: null, initialize() { ajax("/variants", "GET", res => { - this.state.variants = res.variantArray; + this.state.variants = res.variantArray.sort((v1,v2) => v1.localeCompare(v2)); }); let mysid = localStorage.getItem("mysid"); // Assign mysid only once (until next time user clear browser data)