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:
jasquat 2023-01-26 10:50:46 -05:00
parent 356cca8416
commit 21d1d11445
2 changed files with 7 additions and 7 deletions

View File

@ -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]
);

View File

@ -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 (