From ac6bde4159ef98bc7fcbc65dbafea76130189a0b Mon Sep 17 00:00:00 2001 From: Jan Jakes Date: Wed, 3 Jul 2024 16:09:13 +0200 Subject: [PATCH] Improve navigation fallback to point to current page This fixes click on logo e.g. on the Settings page. [MAILPOET-3911] --- .../js/src/common/top-bar/mailpoet-logo-responsive.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mailpoet/assets/js/src/common/top-bar/mailpoet-logo-responsive.tsx b/mailpoet/assets/js/src/common/top-bar/mailpoet-logo-responsive.tsx index 6897fdea95..eafc16707a 100644 --- a/mailpoet/assets/js/src/common/top-bar/mailpoet-logo-responsive.tsx +++ b/mailpoet/assets/js/src/common/top-bar/mailpoet-logo-responsive.tsx @@ -18,7 +18,10 @@ export function MailPoetLogoResponsive({ onClick, withLink = true }: Props) { navigateFallback = () => navigate('/'); } catch (e) { navigateFallback = () => { - window.location.href = `admin.php?page=${MailPoet.mainPageSlug}`; + window.location.href = `admin.php?page=${ + new URL(window.location.href).searchParams.get('page') ?? + MailPoet.mainPageSlug + }`; }; }