mirror of
https://github.com/linuxserver/emulatorjs.git
synced 2026-02-23 00:01:26 +08:00
add logic to reduce items number for counts less than 9
This commit is contained in:
parent
fbf5bc62e6
commit
703d94ed50
6
index.js
6
index.js
@ -191,6 +191,12 @@ io.on('connection', async function (socket) {
|
||||
var config = await fsw.readFile(configPath, 'utf8');
|
||||
var config = JSON.parse(config);
|
||||
config.items = {};
|
||||
if (files.length < 9) {
|
||||
var itemsLength = files.length;
|
||||
} else {
|
||||
var itemsLength = 9;
|
||||
};
|
||||
config.display_items = itemsLength;
|
||||
for await (var file of files) {
|
||||
var fileName = file.replace('.sha1','');
|
||||
var fileExtension = path.extname(fileName);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user