From 81b673068d4ceca09c55e35fac8e6683dde7fb3c Mon Sep 17 00:00:00 2001 From: Jiho Park <59248080+jihorobert@users.noreply.github.com> Date: Wed, 25 Sep 2024 10:12:33 +0900 Subject: [PATCH] fix(fe): delete scrollbar (#2116) --- apps/frontend/app/(main)/settings/page.tsx | 24 ++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/apps/frontend/app/(main)/settings/page.tsx b/apps/frontend/app/(main)/settings/page.tsx index a2b866dde0..254f71fd08 100644 --- a/apps/frontend/app/(main)/settings/page.tsx +++ b/apps/frontend/app/(main)/settings/page.tsx @@ -159,16 +159,20 @@ export default function Page() { options?: NavigateOptions | undefined ): void => { if (updateNow) { - !bypassConfirmation - ? toast.error('You must update your information') - : originalPush(href as Route, options) + if (!bypassConfirmation) { + toast.error('You must update your information') + } else { + originalPush(href as Route, options) + } return } if (!bypassConfirmation) { const isConfirmed = window.confirm( 'Are you sure you want to leave?\nYour changes have not been saved.\nIf you leave this page, all changes will be lost.\nDo you still want to proceed?' ) - isConfirmed ? originalPush(href as Route, options) : null + if (isConfirmed) { + originalPush(href as Route, options) + } return } originalPush(href as Route, options) @@ -252,7 +256,11 @@ export default function Page() { toast.success('Successfully updated your information') setBypassConfirmation(true) setTimeout(() => { - updateNow ? router.push('/') : window.location.reload() + if (updateNow) { + router.push('/') + } else { + window.location.reload() + } }, 1500) } } catch (error) { @@ -324,7 +332,7 @@ export default function Page() {