diff --git a/packages/core/client/src/schema-component/antd/page/pagePopupUtils.tsx b/packages/core/client/src/schema-component/antd/page/pagePopupUtils.tsx index 00496eb174..b38f1fe348 100644 --- a/packages/core/client/src/schema-component/antd/page/pagePopupUtils.tsx +++ b/packages/core/client/src/schema-component/antd/page/pagePopupUtils.tsx @@ -72,6 +72,10 @@ export const storePopupContext = (popupUid: string, params: PopupContextStorage) popupsContextStorage[popupUid] = params; }; +export const deletePopupContext = (popupUid: string) => { + delete popupsContextStorage[popupUid]; +}; + const blockServicesStorage: Record = {}; export const getBlockService = (popupUid: string) => { @@ -300,7 +304,15 @@ export const usePopupUtils = ( navigate(withSearchParams(removeLastPopupPath(location.pathname)), { replace: true }); removePopupLayerState(currentLevel); - }, [isPopupVisibleControlledByURL, setVisibleFromAction, navigate, location?.pathname, currentLevel]); + popupParams?.popupuid && deletePopupContext(popupParams.popupuid); + }, [ + isPopupVisibleControlledByURL, + setVisibleFromAction, + navigate, + location?.pathname, + currentLevel, + popupParams?.popupuid, + ]); const changeTab = useCallback( (key: string) => {