From 7a327596cdb49fb0aa2017489d1534c4a88b99bf Mon Sep 17 00:00:00 2001 From: DispatchCommit Date: Mon, 22 Mar 2021 15:12:59 -0700 Subject: [PATCH] i hate flow --- ui/component/publishForm/view.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/component/publishForm/view.jsx b/ui/component/publishForm/view.jsx index 82b1b2c34..8113e0105 100644 --- a/ui/component/publishForm/view.jsx +++ b/ui/component/publishForm/view.jsx @@ -91,9 +91,9 @@ type Props = { function PublishForm(props: Props) { // Detect upload type from query in URL + const { push, location } = useHistory(); const urlParams = new URLSearchParams(location.search); const uploadType = urlParams.get('type'); - const history = useHistory(); // Component state const [mode, setMode] = React.useState(uploadType || PUBLISH_MODES.FILE); @@ -285,7 +285,7 @@ function PublishForm(props: Props) { if (!uploadType) return; const newParams = new URLSearchParams(); newParams.set('type', mode.toLowerCase()); - history.push({ search: newParams.toString() }); + push({ search: newParams.toString() }); }, [mode, uploadType]); // @if TARGET='web' @@ -401,6 +401,7 @@ function PublishForm(props: Props) { label={__(MODE_TO_I18N_STR[String(modeName)] || '---')} button="alt" onClick={() => { + // $FlowFixMe setMode(modeName); }} className={classnames('button-toggle', { 'button-toggle--active': mode === modeName })}