Page MenuHomePhabricator

D3840.id12086.diff
No OneTemporary

D3840.id12086.diff

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<string>,
- +onChangeAccountPassword: (event: SyntheticEvent<HTMLInputElement>) => void,
+inputDisabled: boolean,
+threadInfo: ThreadInfo,
+setErrorMessage: SetState<string>,
@@ -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<HTMLInputElement>) => {
+ 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<TabType>(
'general',
);
@@ -106,14 +105,6 @@
[queuedChanges],
);
- const onChangeAccountPassword = React.useCallback(
- (event: SyntheticEvent<HTMLInputElement>) => {
- 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 = (
<ThreadSettingsDeleteTab
- accountPassword={accountPassword}
- setAccountPassword={setAccountPassword}
- onChangeAccountPassword={onChangeAccountPassword}
inputDisabled={inputDisabled}
threadInfo={threadInfo}
setErrorMessage={setErrorMessage}

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 28, 1:55 AM (21 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2592381
Default Alt Text
D3840.id12086.diff (3 KB)

Event Timeline