Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
soupette 2021-03-05 11:19:32 +01:00
parent dfb40c08b6
commit f84a1dab0b

View File

@ -68,7 +68,7 @@ const DataManagerProvider = ({
} = useStrapi();
const { apis } = getPlugin(pluginId);
const [infoModals, toggleInfoModal] = useState({ cancel: false });
const { autoReload, currentEnvironment, emitEvent, formatMessage, menu } = useGlobalContext();
const { autoReload, currentEnvironment, emitEvent, formatMessage } = useGlobalContext();
const { fetchUserPermissions } = useUser();
const { pathname } = useLocation();
@ -304,8 +304,6 @@ const DataManagerProvider = ({
// Refetch the permissions
await updatePermissions();
// Update the app menu
await updateAppMenu();
// Refetch all the data
getDataRef.current();
}
@ -474,9 +472,6 @@ const DataManagerProvider = ({
await updatePermissions();
// Update the app menu
await updateAppMenu();
// Submit ct tracking success
if (isInContentTypeView) {
emitEvent('didSaveContentType');
@ -515,13 +510,6 @@ const DataManagerProvider = ({
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 () => {
await fetchUserPermissions();
};