fix: reduce memory usage, by suggestions of @gfwilliams

master
jl 2020-05-11 09:03:46 +02:00
parent 5c3bc8166f
commit 4795ccfd42
1 changed files with 2 additions and 1 deletions

View File

@ -207,6 +207,7 @@ function showSortAppsManually() {
} }
function setSortorder(app, val) { function setSortorder(app, val) {
app = store.readJSON(app.id + '.info', 1);
app.sortorder = val; app.sortorder = val;
store.writeJSON(app.id + '.info', app); store.writeJSON(app.id + '.info', app);
} }
@ -215,7 +216,7 @@ function getAppsList() {
return store.list('.info').map((a)=> { return store.list('.info').map((a)=> {
let app = store.readJSON(a, 1) || {}; let app = store.readJSON(a, 1) || {};
if (app.type !== 'widget') { if (app.type !== 'widget') {
return app; return {id: app.id, name: app.name, sortorder: app.sortorder};
} }
}).filter((a) => a).sort(sortHelper()); }).filter((a) => a).sort(sortHelper());
} }