Skip to content

Commit

Permalink
attempt num 3 lmao
Browse files Browse the repository at this point in the history
  • Loading branch information
zeptofine committed Nov 29, 2023
1 parent 50f696f commit 072d4ce
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Array.from(interleaveSeparators(buttons)).forEach(element => listdiv.appendChild

root = document.querySelector(":root");
function open(sel) {
if (tables[sel] === selected)
if (tables.length < sel || tables[sel] === selected)
return false;

var table;
Expand Down Expand Up @@ -86,8 +86,13 @@ function open(sel) {

// Search Parameter Handler
idx = new URLSearchParams(url.search).get("idx")
if (idx === null || !open(idx)) {
if (idx === null) {
open(0);
} else {
if (tables.length > idx)
open(idx);
else
open(0);
}

for (const button of buttons) {
Expand Down

0 comments on commit 072d4ce

Please sign in to comment.