Improve navigation fallback to point to current page

This fixes click on logo e.g. on the Settings page.

[MAILPOET-3911]
This commit is contained in:
Jan Jakes
2024-07-03 16:09:13 +02:00
committed by Aschepikov
parent 6057163b62
commit ac6bde4159

View File

@@ -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
}`;
};
}