From 703d94ed502b1c5d269b086ea3bc6fc7ef050fca Mon Sep 17 00:00:00 2001 From: thelamer Date: Sat, 23 Oct 2021 12:12:36 -0700 Subject: [PATCH] add logic to reduce items number for counts less than 9 --- index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.js b/index.js index 4077d8b..d290754 100644 --- a/index.js +++ b/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);