fix: allow non category walls in nexus wall select
This commit is contained in:
parent
36adb25231
commit
8f49fdb405
1 changed files with 8 additions and 4 deletions
|
|
@ -102,17 +102,21 @@ PageBase {
|
||||||
const walls = Wallpapers.list;
|
const walls = Wallpapers.list;
|
||||||
const baseDir = Paths.wallsdir;
|
const baseDir = Paths.wallsdir;
|
||||||
const categories = {};
|
const categories = {};
|
||||||
|
const list = [];
|
||||||
for (const w of walls) {
|
for (const w of walls) {
|
||||||
if (w.parentDir !== baseDir) {
|
if (w.parentDir !== baseDir) {
|
||||||
const category = Wallpapers.getCategoryFor(w);
|
const category = Wallpapers.getCategoryFor(w);
|
||||||
if (category && (!(category in categories) || categories[category].name.localeCompare(w.name) > 0))
|
if (category && (!(category in categories) || categories[category].name.localeCompare(w.name) > 0))
|
||||||
categories[category] = w;
|
categories[category] = w;
|
||||||
|
} else {
|
||||||
|
list.push(w);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const cats = Object.values(categories);
|
list.push(...Object.values(categories));
|
||||||
while (cats.length < Config.nexus.wallpapersPerRow)
|
list.sort((a, b) => ((a.parentDir === baseDir) - (b.parentDir === baseDir)) || a.name.localeCompare(b.name));
|
||||||
cats.push(null);
|
while (list.length < Config.nexus.wallpapersPerRow)
|
||||||
return cats;
|
list.push(null);
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
WallItem {
|
WallItem {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue