Skip to content

Commit 703d94e

Browse files
committed
add logic to reduce items number for counts less than 9
1 parent fbf5bc6 commit 703d94e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: index.js

+6
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,12 @@ io.on('connection', async function (socket) {
191191
var config = await fsw.readFile(configPath, 'utf8');
192192
var config = JSON.parse(config);
193193
config.items = {};
194+
if (files.length < 9) {
195+
var itemsLength = files.length;
196+
} else {
197+
var itemsLength = 9;
198+
};
199+
config.display_items = itemsLength;
194200
for await (var file of files) {
195201
var fileName = file.replace('.sha1','');
196202
var fileExtension = path.extname(fileName);

0 commit comments

Comments
 (0)