diff --git a/spiffworkflow-frontend/src/contexts/APIErrorContext.tsx b/spiffworkflow-frontend/src/contexts/APIErrorContext.tsx index bfd7d0092..7e17750f6 100644 --- a/spiffworkflow-frontend/src/contexts/APIErrorContext.tsx +++ b/spiffworkflow-frontend/src/contexts/APIErrorContext.tsx @@ -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] ); diff --git a/spiffworkflow-frontend/src/routes/AdminRoutes.tsx b/spiffworkflow-frontend/src/routes/AdminRoutes.tsx index d87946f1c..43eba9218 100644 --- a/spiffworkflow-frontend/src/routes/AdminRoutes.tsx +++ b/spiffworkflow-frontend/src/routes/AdminRoutes.tsx @@ -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 (