From 8e22f8e73660eaa9e2ffca5b3ece14cb5e0d3204 Mon Sep 17 00:00:00 2001 From: Devon Thomson Date: Mon, 25 Jan 2021 16:34:39 -0500 Subject: [PATCH] Remove onAppLeave in useEffectCleanup to prevent confirm when leaving from listing page (#89041) (#89213) --- .../public/application/components/visualize_top_nav.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/visualize/public/application/components/visualize_top_nav.tsx b/src/plugins/visualize/public/application/components/visualize_top_nav.tsx index 57f4637bda690..2d9105dec4714 100644 --- a/src/plugins/visualize/public/application/components/visualize_top_nav.tsx +++ b/src/plugins/visualize/public/application/components/visualize_top_nav.tsx @@ -150,6 +150,10 @@ const TopNav = ({ } return actions.default(); }); + return () => { + // reset on app leave handler so leaving from the listing page doesn't trigger a confirmation + onAppLeave((actions) => actions.default()); + }; }, [ onAppLeave, hasUnappliedChanges,