diff --git a/web/modals/threads/thread-settings-delete-tab.react.js b/web/modals/threads/thread-settings-delete-tab.react.js --- a/web/modals/threads/thread-settings-delete-tab.react.js +++ b/web/modals/threads/thread-settings-delete-tab.react.js @@ -42,6 +42,8 @@ const dispatchActionPromise = useDispatchActionPromise(); const callDeleteThread = useServerCall(deleteThread); + const accountPasswordInputRef = React.useRef(); + const deleteThreadAction = React.useCallback(async () => { try { const response = await callDeleteThread(threadInfo.id, accountPassword); @@ -52,8 +54,7 @@ e.message === 'invalid_credentials' ? 'wrong password' : 'unkown error', ); setAccountPassword(''); - // TODO: accountPasswordInput.focus() - // (once ref is moved up to functional component) + accountPasswordInputRef.current?.focus(); throw e; } }, [ @@ -93,6 +94,7 @@ value={accountPassword} onChange={onChangeAccountPassword} disabled={inputDisabled} + ref={accountPasswordInputRef} />