mirror of
https://github.com/status-im/spiff-arena.git
synced 2025-01-19 06:31:14 +00:00
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(
|
const contextValue = React.useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
error,
|
error,
|
||||||
addError: (newError: ErrorForDisplay | null) => addError(newError),
|
addError: (newError: ErrorForDisplay | null) => {
|
||||||
removeError: () => removeError(),
|
addError(newError);
|
||||||
|
},
|
||||||
|
removeError: () => {
|
||||||
|
removeError();
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
[error]
|
[error]
|
||||||
);
|
);
|
||||||
|
@ -23,15 +23,11 @@ import Configuration from './Configuration';
|
|||||||
import JsonSchemaFormBuilder from './JsonSchemaFormBuilder';
|
import JsonSchemaFormBuilder from './JsonSchemaFormBuilder';
|
||||||
import ProcessModelNewExperimental from './ProcessModelNewExperimental';
|
import ProcessModelNewExperimental from './ProcessModelNewExperimental';
|
||||||
import ProcessInstanceFindById from './ProcessInstanceFindById';
|
import ProcessInstanceFindById from './ProcessInstanceFindById';
|
||||||
import useAPIError from '../hooks/UseApiError';
|
|
||||||
|
|
||||||
export default function AdminRoutes() {
|
export default function AdminRoutes() {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const { removeError } = useAPIError();
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {}, [location]);
|
||||||
removeError();
|
|
||||||
}, [location, removeError]);
|
|
||||||
|
|
||||||
if (UserService.hasRole(['admin'])) {
|
if (UserService.hasRole(['admin'])) {
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user