diff options
author | Vitaly Takmazov | 2023-05-19 02:39:47 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-05-19 02:54:34 +0300 |
commit | 71acbc9791ad42f99757feb9ed03e208fd09aa70 (patch) | |
tree | 02be8ff9af14bcc3592c442c95fe1596391856f6 /vnext/src/ui/Settings.js | |
parent | 56c7241c2ff3e62b2f6f8064f985181f4387dd3d (diff) |
Fix linter warnings
Diffstat (limited to 'vnext/src/ui/Settings.js')
-rw-r--r-- | vnext/src/ui/Settings.js | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/vnext/src/ui/Settings.js b/vnext/src/ui/Settings.js index 6e9d4f36..380d8ff6 100644 --- a/vnext/src/ui/Settings.js +++ b/vnext/src/ui/Settings.js @@ -32,16 +32,14 @@ function ChangeAvatarForm({ onChange }) { if (preview) { previewUser = { ...visitor, avatar: preview, uname: '<preview>' }; } - let onSubmitAvatar = (event) => { + let onSubmitAvatar = async (event) => { if (event.preventDefault) { event.preventDefault(); } - updateAvatar(avatarInput.current.files[0]).then(() => { - avatarChanged(''); - me().then(visitor => { - onChange(visitor); - }).catch(console.error); - }).catch(console.error); + await updateAvatar(avatarInput.current.files[0]); + avatarChanged(''); + let visitor = await me(); + onChange(visitor); }; return ( <form> @@ -124,20 +122,20 @@ export default function Settings({ onChange }) { {visitor.telegramName ? ( <form> <div>Telegram: <b> {visitor.telegramName} </b> — - <Button onClick={disableTelegram}>Disable</Button> + <Button onClick={disableTelegram}>Disable</Button> </div> </form> ) : ( - <p>To connect Telegram account: send any text message to <a href="https://telegram.me/Juick_bot">@Juick_bot</a> - </p> - )} + <p>To connect Telegram account: send any text message to <a href="https://telegram.me/Juick_bot">@Juick_bot</a> + </p> + )} </fieldset> { visitor.jids && ( <form> <fieldset> <legend>XMPP accounts - </legend> + </legend> <p>Your accounts:</p> <p> { @@ -205,7 +203,7 @@ export default function Settings({ onChange }) { {/** /email_off */} <p> </p> <p>You can post to Juick via e-mail. Send your <u>plain text</u> messages to <a href="mailto:juick@juick.com">juick@juick.com</a>. - You can attach one photo or video file.</p> + You can attach one photo or video file.</p> </> } </fieldset> @@ -228,19 +226,19 @@ export default function Settings({ onChange }) { </div> </form> ) : ( - <p>Cross-posting to Facebook: - <a href="/_fblogin"> - <img src="//static.juick.com/facebook-connect.png" alt="Connect to Facebook" /> - </a> - </p> - )} + <p>Cross-posting to Facebook: + <a href="/_fblogin"> + <img src="//static.juick.com/facebook-connect.png" alt="Connect to Facebook" /> + </a> + </p> + )} </fieldset> <fieldset> <legend><Icon name="ei-sc-twitter" size="m" />Twitter</legend> {visitor.twitterName ? <form action="/settings" method="post"> <div>Twitter: <b>{visitor.twitterName}</b>— - <input type="hidden" name="page" value="twitter-del" /> + <input type="hidden" name="page" value="twitter-del" /> <Button onClick={disableTwitter}>Disable</Button> </div> </form> |