Skip to content

Commit

Permalink
fix: error component showing inaccurate errors. Fixes argoproj#9274 (a…
Browse files Browse the repository at this point in the history
…rgoproj#10128)

Signed-off-by: Mayursinh Sarvaiya <[email protected]>
  • Loading branch information
Marvin9 authored Nov 29, 2022
1 parent 311f151 commit 1225d8b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ui/src/app/shared/components/error-notice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ export const ErrorNotice = (props: {style?: CSSProperties; error: Error & {respo
if (!props.error) {
return null;
}
const [error, setError] = useState(props.error); // allow us to close the error panel - in case it does not get automatically closed
const [error, setError] = useState(() => props.error); // allow us to close the error panel - in case it does not get automatically closed

useEffect(() => {
setError(props.error);
}, [props.error]);

// This timer code is based on https://stackoverflow.com/questions/57137094/implementing-a-countdown-timer-in-react-with-hooks
const reloadAfterSeconds = props.reloadAfterSeconds || 120;
const reload = props.onReload;
Expand Down

0 comments on commit 1225d8b

Please sign in to comment.