From e48d3264890163148d78d63d36422788b67ed8b9 Mon Sep 17 00:00:00 2001 From: ducksel Date: Sat, 15 Nov 2025 20:27:44 -0600 Subject: [PATCH] Fix off by one error in random loading text --- assets/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/main.js b/assets/main.js index d6aef21..7eb247f 100644 --- a/assets/main.js +++ b/assets/main.js @@ -69,8 +69,10 @@ function Load (text) { const loadArray = text.split("\n") const loading = document.getElementsByClassName("loading")[0] - const r = Math.floor(Math.random() * loadArray.length) + const r = Math.floor(Math.random() * (loadArray.length-1)) const loadText = loadArray[r] + if (loadText === '') //Error message on bad string + alert("Please tell a linuxposting.xyz admin member: Error Code 0x756C2D616F6365640A72") loading.children[0].innerHTML = loadText + "." loading.children[1].innerHTML = loadText + ".." @@ -341,4 +343,4 @@ window.addEventListener("resize", () => { resizeTimeout = setTimeout(() => { document.documentElement.style.setProperty('--vh', `${window.innerHeight * 0.01}px`) }, 200) -}) \ No newline at end of file +})