diff --git a/web/modals/threads/settings/thread-settings-delete-tab.react.js b/web/modals/threads/settings/thread-settings-delete-tab.react.js --- a/web/modals/threads/settings/thread-settings-delete-tab.react.js +++ b/web/modals/threads/settings/thread-settings-delete-tab.react.js @@ -16,7 +16,6 @@ import { buttonThemes } from '../../../components/button.react'; import SWMansionIcon from '../../../SWMansionIcon.react'; -import Input from '../../input.react'; import SubmitSection from './submit-section.react'; import css from './thread-settings-delete-tab.css'; @@ -41,41 +40,21 @@ const dispatchActionPromise = useDispatchActionPromise(); const callDeleteThread = useServerCall(deleteThread); - const accountPasswordInputRef = React.useRef(); - const [accountPassword, setAccountPassword] = React.useState(''); - - const onChangeAccountPassword = React.useCallback( - (event: SyntheticEvent) => { - const target = event.currentTarget; - setAccountPassword(target.value); - }, - [], - ); - const deleteThreadAction = React.useCallback(async () => { try { setErrorMessage(''); - const response = await callDeleteThread(threadInfo.id, accountPassword); + const response = await callDeleteThread(threadInfo.id); modalContext.popModal(); return response; } catch (e) { setErrorMessage( e.message === 'invalid_credentials' - ? 'wrong password' + ? 'permission not granted' : 'unknown error', ); - setAccountPassword(''); - accountPasswordInputRef.current?.focus(); throw e; } - }, [ - accountPassword, - callDeleteThread, - modalContext, - setAccountPassword, - setErrorMessage, - threadInfo.id, - ]); + }, [callDeleteThread, modalContext, setErrorMessage, threadInfo.id]); const onDelete = React.useCallback( (event: SyntheticEvent) => { @@ -100,30 +79,12 @@

-
-

- Please enter your account password to confirm your identity. -

-
Account password
-
- -
-
Delete