From 517d3f9400d9a028abb8eab2dbddc3d6c11b15ed Mon Sep 17 00:00:00 2001 From: Wojciech Mista Date: Mon, 31 Jan 2022 09:30:13 +0100 Subject: [PATCH] Reload page after navigation after error (#1795) --- src/components/AppLayout/AppLayout.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/AppLayout/AppLayout.tsx b/src/components/AppLayout/AppLayout.tsx index 6c4ba3dfb..0c61f065e 100644 --- a/src/components/AppLayout/AppLayout.tsx +++ b/src/components/AppLayout/AppLayout.tsx @@ -149,14 +149,19 @@ const AppLayout: React.FC = ({ children }) => { const handleMenuItemClick = (url: string) => navigate(url, { resetScroll: true }); + const reloadWindow = () => { + window.location.reload(); + }; + const handleErrorBack = () => { - navigate("/"); + navigate("/", { replace: true }); dispatchAppState({ payload: { error: null }, type: "displayError" }); + reloadWindow(); }; const toggleTheme = () => setTheme(isDarkTheme(themeType) ? "light" : "dark");