Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3507358
D6105.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D6105.diff
View Options
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<HTMLInputElement>) => {
- 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<HTMLElement>) => {
@@ -100,30 +79,12 @@
</p>
</div>
</div>
- <div>
- <p className={css.confirm_account_password}>
- Please enter your account password to confirm your identity.
- </p>
- <div className={css.form_title}>Account password</div>
- <div className={css.form_content}>
- <Input
- type="password"
- placeholder="Password"
- value={accountPassword}
- onChange={onChangeAccountPassword}
- disabled={threadSettingsOperationInProgress}
- ref={accountPasswordInputRef}
- />
- </div>
- </div>
<SubmitSection
errorMessage={errorMessage}
onClick={onDelete}
variant="filled"
buttonColor={buttonThemes.danger}
- disabled={
- threadSettingsOperationInProgress || accountPassword.length === 0
- }
+ disabled={threadSettingsOperationInProgress}
>
Delete
</SubmitSection>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 8:29 PM (17 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2688983
Default Alt Text
D6105.diff (2 KB)
Attached To
Mode
D6105: Do not prompt for password when deleting thread on web
Attached
Detach File
Event Timeline
Log In to Comment