diff --git a/app/soapbox/components/authorize-reject-buttons.tsx b/app/soapbox/components/authorize-reject-buttons.tsx index 347201e1b..9edd44189 100644 --- a/app/soapbox/components/authorize-reject-buttons.tsx +++ b/app/soapbox/components/authorize-reject-buttons.tsx @@ -26,15 +26,20 @@ const AuthorizeRejectButtons: React.FC = ({ onAuthorize } setState('pending'); } else { - setState(present); - timeout.current = setTimeout(async () => { + const doAction = async () => { try { await action(); setState(past); } catch (e) { console.error(e); } - }, countdown); + }; + if (typeof countdown === 'number') { + setState(present); + timeout.current = setTimeout(doAction, countdown); + } else { + doAction(); + } } }