From 695b9a3d72faf5b5190518ac1bee4cb2a3e3a799 Mon Sep 17 00:00:00 2001 From: vishnuraghavb Date: Sat, 23 Jan 2021 23:10:30 +0530 Subject: [PATCH] case insensitive list sorting --- app/store.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/store.js b/app/store.js index 494f1804..0b896359 100644 --- a/app/store.js +++ b/app/store.js @@ -180,9 +180,9 @@ export default new Vuex.Store({ imp: "\ue918", info: "\ue919", items: "\ue91a", - l1:"\ue91b", - l2:"\ue91c", - l3:"\ue91d", + l1: "\ue91b", + l2: "\ue91c", + l3: "\ue91d", lang: "\ue91e", left: "\ue91f", menu: "\ue920", @@ -190,8 +190,8 @@ export default new Vuex.Store({ notes: "\ue922", plus: "\ue923", plusc: "\ue924", - price:"\ue925", - priv:"\ue926", + price: "\ue925", + priv: "\ue926", err: "\ue90f", res: "\ue927", reset: "\ue928", @@ -296,7 +296,7 @@ export default new Vuex.Store({ r.rating = 0 if (!r.hasOwnProperty("created")) r.created = r.lastModified - // if (!r.hasOwnProperty("inBag")) + // if (!r.hasOwnProperty("inBag")) // r.inBag = false state.recipes.push(r); }); @@ -326,7 +326,7 @@ export default new Vuex.Store({ r.rating = 0 if (!r.hasOwnProperty("created")) r.created = r.lastModified - // if (!r.hasOwnProperty("inBag")) + // if (!r.hasOwnProperty("inBag")) // r.inBag = false return r; }); @@ -468,9 +468,9 @@ export default new Vuex.Store({ state[stateName].push(item); db.updateDocument(key, {[key]: state[stateName]}); if (listItems[listName].sort) - state[stateName].sort(); - } - }, + state[stateName].sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase())) + } + }, removeListItem(state, {item, listName}) { let db = listItems[listName].db; let key = listItems[listName].key;