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 @@ -18,9 +18,6 @@ import css from './thread-settings-modal.css'; type ThreadSettingsDeleteTabProps = { - +accountPassword: string, - +setAccountPassword: SetState, - +onChangeAccountPassword: (event: SyntheticEvent) => void, +inputDisabled: boolean, +threadInfo: ThreadInfo, +setErrorMessage: SetState, @@ -29,20 +26,22 @@ function ThreadSettingsDeleteTab( props: ThreadSettingsDeleteTabProps, ): React.Node { - const { - accountPassword, - setAccountPassword, - onChangeAccountPassword, - inputDisabled, - threadInfo, - setErrorMessage, - } = props; + const { inputDisabled, threadInfo, setErrorMessage } = props; const modalContext = useModalContext(); 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 { diff --git a/web/modals/threads/thread-settings-modal.react.js b/web/modals/threads/thread-settings-modal.react.js --- a/web/modals/threads/thread-settings-modal.react.js +++ b/web/modals/threads/thread-settings-modal.react.js @@ -87,7 +87,6 @@ ); const modalContext = useModalContext(); const [errorMessage, setErrorMessage] = React.useState(''); - const [accountPassword, setAccountPassword] = React.useState(''); const [currentTabType, setCurrentTabType] = React.useState( 'general', ); @@ -106,14 +105,6 @@ [queuedChanges], ); - const onChangeAccountPassword = React.useCallback( - (event: SyntheticEvent) => { - const target = event.currentTarget; - setAccountPassword(target.value); - }, - [], - ); - const hasPermissionForTab = React.useCallback( (thread: ThreadInfo, tab: TabType) => { if (tab === 'general') { @@ -148,7 +139,6 @@ return response; } catch (e) { setErrorMessage('unknown_error'); - setAccountPassword(''); setCurrentTabType('general'); setQueuedChanges(Object.freeze({})); throw e; @@ -212,9 +202,6 @@ } else if (currentTabType === 'delete') { mainContent = (