mirror of
https://github.com/strapi/strapi.git
synced 2025-12-04 19:13:20 +00:00
Fix cetb
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
dfb40c08b6
commit
f84a1dab0b
@ -68,7 +68,7 @@ const DataManagerProvider = ({
|
|||||||
} = useStrapi();
|
} = useStrapi();
|
||||||
const { apis } = getPlugin(pluginId);
|
const { apis } = getPlugin(pluginId);
|
||||||
const [infoModals, toggleInfoModal] = useState({ cancel: false });
|
const [infoModals, toggleInfoModal] = useState({ cancel: false });
|
||||||
const { autoReload, currentEnvironment, emitEvent, formatMessage, menu } = useGlobalContext();
|
const { autoReload, currentEnvironment, emitEvent, formatMessage } = useGlobalContext();
|
||||||
const { fetchUserPermissions } = useUser();
|
const { fetchUserPermissions } = useUser();
|
||||||
|
|
||||||
const { pathname } = useLocation();
|
const { pathname } = useLocation();
|
||||||
@ -304,8 +304,6 @@ const DataManagerProvider = ({
|
|||||||
// Refetch the permissions
|
// Refetch the permissions
|
||||||
await updatePermissions();
|
await updatePermissions();
|
||||||
|
|
||||||
// Update the app menu
|
|
||||||
await updateAppMenu();
|
|
||||||
// Refetch all the data
|
// Refetch all the data
|
||||||
getDataRef.current();
|
getDataRef.current();
|
||||||
}
|
}
|
||||||
@ -474,9 +472,6 @@ const DataManagerProvider = ({
|
|||||||
|
|
||||||
await updatePermissions();
|
await updatePermissions();
|
||||||
|
|
||||||
// Update the app menu
|
|
||||||
await updateAppMenu();
|
|
||||||
|
|
||||||
// Submit ct tracking success
|
// Submit ct tracking success
|
||||||
if (isInContentTypeView) {
|
if (isInContentTypeView) {
|
||||||
emitEvent('didSaveContentType');
|
emitEvent('didSaveContentType');
|
||||||
@ -515,13 +510,6 @@ const DataManagerProvider = ({
|
|||||||
toggleInfoModal(prev => ({ ...prev, cancel: !prev.cancel }));
|
toggleInfoModal(prev => ({ ...prev, cancel: !prev.cancel }));
|
||||||
};
|
};
|
||||||
|
|
||||||
// Update the menu using the internal API
|
|
||||||
const updateAppMenu = async () => {
|
|
||||||
if (menu.getModels) {
|
|
||||||
await menu.getModels();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const updatePermissions = async () => {
|
const updatePermissions = async () => {
|
||||||
await fetchUserPermissions();
|
await fetchUserPermissions();
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user