From d56850fc246777767fdabf2a47d4a01e380ee5cf Mon Sep 17 00:00:00 2001 From: Miodec Date: Mon, 2 Oct 2023 16:26:30 +0100 Subject: [PATCH] fix(funbox): layoutfluid not working correctly in some cases or with 2 layouts --- frontend/src/ts/test/funbox/funbox.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/src/ts/test/funbox/funbox.ts b/frontend/src/ts/test/funbox/funbox.ts index ce7800953..971b48b59 100644 --- a/frontend/src/ts/test/funbox/funbox.ts +++ b/frontend/src/ts/test/funbox/funbox.ts @@ -259,13 +259,12 @@ FunboxList.setFunboxFunctions("layoutfluid", { const mod = wordsPerLayout - ((TestWords.words.currentIndex + 1) % wordsPerLayout); - console.log(wordsPerLayout); - console.log(mod); - - if (layouts[index + 1]) { - if (mod <= 3) { + if (layouts[index]) { + if (mod <= 3 && layouts[index + 1]) { LayoutfluidFunboxTimer.show(); LayoutfluidFunboxTimer.updateWords(mod, layouts[index + 1]); + } else { + LayoutfluidFunboxTimer.hide(); } if (mod === wordsPerLayout) { UpdateConfig.setLayout(layouts[index]);