Skip to content

Commit

Permalink
Merge pull request #284 from CaritasDeutschland/COBH-4049-MultiRedirect
Browse files Browse the repository at this point in the history
Cobh 4049 multi redirect
  • Loading branch information
mebo4b authored Dec 7, 2021
2 parents 4b25772 + ec87ea8 commit 3ab2ac9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ export const Button = (props: ButtonProps) => {

useEffect(() => {
handleButtonTimer();

return (): void => {
if (timeoutID) window.clearTimeout(timeoutID);
};
}, []); // eslint-disable-line react-hooks/exhaustive-deps

const handleButtonTimer = () => {
Expand Down Expand Up @@ -87,7 +91,7 @@ export const Button = (props: ButtonProps) => {
}

if (!props.disabled && !props.item.disabled && props.buttonHandle) {
window.clearTimeout(timeoutID);
if (timeoutID) window.clearTimeout(timeoutID);
props.buttonHandle(item.function);
}
};
Expand Down

0 comments on commit 3ab2ac9

Please sign in to comment.