1
0
Fork 0

Merge pull request #402 from jl-cs/feature/app-sorting

App Manager Sorting: use less memory
master
Gordon Williams 2020-05-11 10:51:49 +01:00 committed by GitHub
commit 63901b34b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -1,2 +1,3 @@
0.02: Fix deletion of apps - now use files list in app.info (fix #262) 0.02: Fix deletion of apps - now use files list in app.info (fix #262)
0.03: Add support for data files 0.03: Add support for data files
0.04: Add functionality to sort apps manually or alphabetically ascending/descending.

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());
} }