feat: add deletePopupContext function to manage popup context storage (#6411)

This commit is contained in:
Zeke Zhang 2025-03-11 14:30:37 +08:00 committed by GitHub
parent 5ade85acd4
commit d90c17b3a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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<string, { service: any }> = {};
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) => {