From f11de8db126be69405722a162b84c760b46601e2 Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Mon, 30 Jan 2023 21:34:40 +0530 Subject: [PATCH] minor code refactoring --- index.html | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/index.html b/index.html index 2a3e0e0..cf3c7f7 100644 --- a/index.html +++ b/index.html @@ -1005,19 +1005,9 @@ } else { if (targetPage.includes('/')) { - if (targetPage.includes('?')) { - const splitAddress = targetPage.split('?') - searchParams = splitAddress.pop() - const pages = splitAddress.pop().split('/') - pageId = pages[1] - subPageId1 = pages[2] - subPageId2 = pages[3] - } else { - const pages = targetPage.split('/') - pageId = pages[1] - subPageId1 = pages[2] - subPageId2 = pages[3] - } + let path; + [path, searchParams] = targetPage.split('?'); + [, pageId] = path.split('/') } else { pageId = targetPage }