From f46b9b9b7361a676167260974adc635767890407 Mon Sep 17 00:00:00 2001 From: Rushaway Date: Sun, 10 Nov 2024 12:26:46 +0100 Subject: [PATCH] fix(js): tab navigation logic and validation in admin panel (#1004) --- web/scripts/sourcebans.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/scripts/sourcebans.js b/web/scripts/sourcebans.js index 4ea139ab6..f420d5ed3 100644 --- a/web/scripts/sourcebans.js +++ b/web/scripts/sourcebans.js @@ -65,14 +65,14 @@ function ProcessAdminTabs() const pos = url.indexOf('^') + 1; const tabNo = url.charAt(pos); - if(Number.isInteger(tabNo)) + if (!isNaN(utabNo)) swapTab(tabNo); const upos = url.indexOf('~') + 1; const utabNo = url.charAt(upos + 1); const utabType = url.charAt(upos); - if(Number.isInteger(utabNo)) + if (!isNaN(utabNo)) Swap2ndPane(utabNo, utabType); } @@ -1472,6 +1472,6 @@ function openTab(event, target) { function swapTab(tab) { const menu = document.getElementById('admin-page-menu').children; - if(Number.isInteger(tab) && tab <= menu.length) + if(!isNaN(tab) && tab <= menu.length) menu[tab].click(); }