@applica-software-guru/react-admin 1.5.314 → 1.5.315
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Layout/Provider.d.ts.map +1 -1
- package/dist/react-admin.cjs.js +25 -25
- package/dist/react-admin.cjs.js.gz +0 -0
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +2966 -2964
- package/dist/react-admin.es.js.gz +0 -0
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +25 -25
- package/dist/react-admin.umd.js.gz +0 -0
- package/dist/react-admin.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Layout/Provider.tsx +4 -1
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@ import { Dialog, useMediaQuery, useTheme } from '@mui/material';
|
|
|
6
6
|
import _ from 'lodash';
|
|
7
7
|
import { UseGetIdentityResult, useAuthProvider, useGetIdentity } from 'ra-core';
|
|
8
8
|
import { createContext, forwardRef, useCallback, useContext, useEffect, useMemo, useReducer, useState } from 'react';
|
|
9
|
+
import { useLoading } from 'react-admin';
|
|
9
10
|
|
|
10
11
|
enum LayoutActionType {
|
|
11
12
|
UPDATE_MEDIA = 'updateMedia',
|
|
@@ -154,6 +155,7 @@ function LayoutProvider(props: ILayoutProviderProps) {
|
|
|
154
155
|
const handlePasswordChange = useCallback(() => setNeedToChangePassword(false), []);
|
|
155
156
|
const value = useMemo(() => ({ state, dispatch }), [state, dispatch]);
|
|
156
157
|
const { logoIcon, logoMain, enableNotification, notification } = props;
|
|
158
|
+
const isLayoutLoading = useLoading();
|
|
157
159
|
|
|
158
160
|
useEffect(() => {
|
|
159
161
|
dispatch({
|
|
@@ -216,6 +218,7 @@ function LayoutProvider(props: ILayoutProviderProps) {
|
|
|
216
218
|
}, [theme.palette.mode]);
|
|
217
219
|
|
|
218
220
|
useEffect(() => {
|
|
221
|
+
if (isLayoutLoading) return;
|
|
219
222
|
// Check if authProvider contains a method called isImpersonating
|
|
220
223
|
if (!authProvider.isImpersonating) {
|
|
221
224
|
// eslint-disable-next-line no-console
|
|
@@ -225,7 +228,7 @@ function LayoutProvider(props: ILayoutProviderProps) {
|
|
|
225
228
|
authProvider?.isImpersonating().then((isImpersonating: boolean) => {
|
|
226
229
|
setNeedToChangePassword(!isImpersonating && identity?.data?.needToChangePassword === true);
|
|
227
230
|
});
|
|
228
|
-
}, [identity?.data?.needToChangePassword, authProvider]);
|
|
231
|
+
}, [identity?.data?.needToChangePassword, authProvider, isLayoutLoading]);
|
|
229
232
|
|
|
230
233
|
return (
|
|
231
234
|
<LayoutContext.Provider value={value}>
|