do not reset error state from the adminroutes component since this causes the error to be removed right away and then cannot be displayed w/ burnettk
This commit is contained in:
parent
356cca8416
commit
21d1d11445
|
@ -25,8 +25,12 @@ export default function APIErrorProvider({ children }) {
|
|||
const contextValue = React.useMemo(
|
||||
() => ({
|
||||
error,
|
||||
addError: (newError: ErrorForDisplay | null) => addError(newError),
|
||||
removeError: () => removeError(),
|
||||
addError: (newError: ErrorForDisplay | null) => {
|
||||
addError(newError);
|
||||
},
|
||||
removeError: () => {
|
||||
removeError();
|
||||
},
|
||||
}),
|
||||
[error]
|
||||
);
|
||||
|
|
|
@ -23,15 +23,11 @@ import Configuration from './Configuration';
|
|||
import JsonSchemaFormBuilder from './JsonSchemaFormBuilder';
|
||||
import ProcessModelNewExperimental from './ProcessModelNewExperimental';
|
||||
import ProcessInstanceFindById from './ProcessInstanceFindById';
|
||||
import useAPIError from '../hooks/UseApiError';
|
||||
|
||||
export default function AdminRoutes() {
|
||||
const location = useLocation();
|
||||
const { removeError } = useAPIError();
|
||||
|
||||
useEffect(() => {
|
||||
removeError();
|
||||
}, [location, removeError]);
|
||||
useEffect(() => {}, [location]);
|
||||
|
||||
if (UserService.hasRole(['admin'])) {
|
||||
return (
|
||||
|
|
Loading…
Reference in New Issue