Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3175267
D3840.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D3840.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 8, 7:53 PM (20 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2445255
Default Alt Text
D3840.diff (3 KB)
Attached To
Mode
D3840: [web] Push `accountPassword` state and related functionality down to `ThreadSettingsDeleteTab`
Attached
Detach File
Event Timeline
Log In to Comment