From dd3cd788a528a76d501d2c6fb68479c864526704 Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Tue, 24 Jan 2023 23:08:23 +0530 Subject: [PATCH] code refactoring --- index.html | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 5bedb78..e0ebe4f 100644 --- a/index.html +++ b/index.html @@ -1725,13 +1725,9 @@ } } else { if (targetPage.includes('/')) { - if (targetPage.includes('?')) { - const splitAddress = targetPage.split('?') - searchParams = splitAddress.pop(); - [, pageId, subPageId1, subPageId2] = splitAddress.pop().split('/') - } else { - [, pageId, subPageId1, subPageId2] = targetPage.split('/') - } + let path; + [path, searchParams] = targetPage.split('?'); + [, pageId, subPageId1, subPageId2] = path.split('/') } else { pageId = targetPage }