mirror of
https://github.com/wassname/talk.git
synced 2026-07-14 11:18:50 +08:00
fix: adjusted onsubmit handlers (#2705)
This commit is contained in:
committed by
Kim Gardner
parent
033433549a
commit
a55472e086
@@ -11,8 +11,9 @@ interface Props {
|
||||
|
||||
const DownloadForm: FunctionComponent<Props> = ({ token }) => {
|
||||
const [submitted, setSubmitted] = useState(false);
|
||||
const onClick = useCallback(() => {
|
||||
const onSubmit = useCallback(() => {
|
||||
setSubmitted(true);
|
||||
return true;
|
||||
}, [setSubmitted]);
|
||||
|
||||
return (
|
||||
@@ -21,15 +22,15 @@ const DownloadForm: FunctionComponent<Props> = ({ token }) => {
|
||||
className={styles.form}
|
||||
method="post"
|
||||
action="/api/account/download"
|
||||
onSubmit={onSubmit}
|
||||
>
|
||||
<input name="token" type="hidden" value={token} />
|
||||
<Localized id="download-landingPage-downloadComments ">
|
||||
<Localized id="download-landingPage-downloadComments">
|
||||
<Button
|
||||
type="submit"
|
||||
variant="filled"
|
||||
color="primary"
|
||||
disabled={submitted}
|
||||
onClick={onClick}
|
||||
className={styles.downloadButton}
|
||||
>
|
||||
Download My Comment History
|
||||
|
||||
Reference in New Issue
Block a user