mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-06 14:09:25 +08:00
feat: add deletePopupContext function to manage popup context storage (#6411)
This commit is contained in:
parent
5ade85acd4
commit
d90c17b3a4
@ -72,6 +72,10 @@ export const storePopupContext = (popupUid: string, params: PopupContextStorage)
|
|||||||
popupsContextStorage[popupUid] = params;
|
popupsContextStorage[popupUid] = params;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const deletePopupContext = (popupUid: string) => {
|
||||||
|
delete popupsContextStorage[popupUid];
|
||||||
|
};
|
||||||
|
|
||||||
const blockServicesStorage: Record<string, { service: any }> = {};
|
const blockServicesStorage: Record<string, { service: any }> = {};
|
||||||
|
|
||||||
export const getBlockService = (popupUid: string) => {
|
export const getBlockService = (popupUid: string) => {
|
||||||
@ -300,7 +304,15 @@ export const usePopupUtils = (
|
|||||||
|
|
||||||
navigate(withSearchParams(removeLastPopupPath(location.pathname)), { replace: true });
|
navigate(withSearchParams(removeLastPopupPath(location.pathname)), { replace: true });
|
||||||
removePopupLayerState(currentLevel);
|
removePopupLayerState(currentLevel);
|
||||||
}, [isPopupVisibleControlledByURL, setVisibleFromAction, navigate, location?.pathname, currentLevel]);
|
popupParams?.popupuid && deletePopupContext(popupParams.popupuid);
|
||||||
|
}, [
|
||||||
|
isPopupVisibleControlledByURL,
|
||||||
|
setVisibleFromAction,
|
||||||
|
navigate,
|
||||||
|
location?.pathname,
|
||||||
|
currentLevel,
|
||||||
|
popupParams?.popupuid,
|
||||||
|
]);
|
||||||
|
|
||||||
const changeTab = useCallback(
|
const changeTab = useCallback(
|
||||||
(key: string) => {
|
(key: string) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user