From bc916715c8d89b18b96b6eca4296ecd2a109d27a Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Fri, 31 Oct 2025 11:26:41 +0800 Subject: [PATCH] fix second overlay is shown when closing the wide RHP --- src/components/WideRHPContextProvider/index.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/WideRHPContextProvider/index.tsx b/src/components/WideRHPContextProvider/index.tsx index cde7c8f11c88..79ab89d880ae 100644 --- a/src/components/WideRHPContextProvider/index.tsx +++ b/src/components/WideRHPContextProvider/index.tsx @@ -153,9 +153,8 @@ function WideRHPContextProvider({children}: React.PropsWithChildren) { return false; } - // Check the focused route to avoid glitching when quickly close and open RHP. - if (wideRHPRouteKeys.length > 0 && !wideRHPRouteKeys.includes(focusedRoute.key) && isRHPLastRootRoute && focusedRoute.name !== SCREENS.SEARCH.REPORT_RHP) { - return true; + if (isRHPLastRootRoute && focusedRoute.name !== SCREENS.SEARCH.REPORT_RHP) { + return !!state?.routes.at(-1)?.state?.routes.find((route) => route.name === SCREENS.RIGHT_MODAL.SEARCH_REPORT); } return false;