diff options
Diffstat (limited to 'vnext/src/ui')
-rw-r--r-- | vnext/src/ui/Chat.js | 2 | ||||
-rw-r--r-- | vnext/src/ui/Contacts.js | 2 | ||||
-rw-r--r-- | vnext/src/ui/Icon.js | 1 | ||||
-rw-r--r-- | vnext/src/ui/MessageInput.js | 24 | ||||
-rw-r--r-- | vnext/src/ui/Settings.js | 10 | ||||
-rw-r--r-- | vnext/src/ui/UserInfo.js | 3 |
6 files changed, 21 insertions, 21 deletions
diff --git a/vnext/src/ui/Chat.js b/vnext/src/ui/Chat.js index 0f8f53ba..f7113aaa 100644 --- a/vnext/src/ui/Chat.js +++ b/vnext/src/ui/Chat.js @@ -34,7 +34,7 @@ export default function Chat(props) { getChat(uname) .then(response => { setChats(response.data); - }); + }).catch(console.log); } }, []); diff --git a/vnext/src/ui/Contacts.js b/vnext/src/ui/Contacts.js index 07e4dfc4..b1f87723 100644 --- a/vnext/src/ui/Contacts.js +++ b/vnext/src/ui/Contacts.js @@ -16,7 +16,7 @@ export default function Contacts() { getChats() .then(response => { setPms(response.data.pms); - }); + }).catch(console.log); }, []); return ( <div className="msg-cont"> diff --git a/vnext/src/ui/Icon.js b/vnext/src/ui/Icon.js index acf7bccf..a9cd8a95 100644 --- a/vnext/src/ui/Icon.js +++ b/vnext/src/ui/Icon.js @@ -1,7 +1,6 @@ import { createElement, memo } from 'react'; import PropTypes from 'prop-types'; -// @ts-ignore import evilIcons from 'evil-icons/assets/sprite.svg'; /** diff --git a/vnext/src/ui/MessageInput.js b/vnext/src/ui/MessageInput.js index aa4454a1..de4edc7f 100644 --- a/vnext/src/ui/MessageInput.js +++ b/vnext/src/ui/MessageInput.js @@ -89,25 +89,27 @@ export default function MessageInput({ text, rows, placeholder, onSend }) { let uploadValueChanged = (attach) => { setAttach(attach); }; - let onSubmit = async (event) => { + let onSubmit = (event) => { if (event.preventDefault) { event.preventDefault(); } const input = fileinput.current; if (input && input.files) { - if (await onSend({ + onSend({ body: body, attach: attach ? input.files[0] : '' - })) { - setAttach(''); - setBody(''); - if (textareaRef.current) { - textareaRef.current.style.height = ''; + }).then((success) => { + if (success) { + setAttach(''); + setBody(''); + if (textareaRef.current) { + textareaRef.current.style.height = ''; + } + updateFocus(); + } else { + toast('Can not update this message'); } - updateFocus(); - } else { - toast('Can not update this message'); - } + }).catch(console.log); } }; return ( diff --git a/vnext/src/ui/Settings.js b/vnext/src/ui/Settings.js index 82fbcc9e..6e9d4f36 100644 --- a/vnext/src/ui/Settings.js +++ b/vnext/src/ui/Settings.js @@ -40,8 +40,8 @@ function ChangeAvatarForm({ onChange }) { avatarChanged(''); me().then(visitor => { onChange(visitor); - }); - }); + }).catch(console.error); + }).catch(console.error); }; return ( <form> @@ -93,13 +93,13 @@ export default function Settings({ onChange }) { console.log('twitter disable'); }; let deleteJid = () => { - + // TODO }; let addEmail = () => { - + // TODO }; let deleteEmail = () => { - + // TODO }; return ( <div className="msg-cont"> diff --git a/vnext/src/ui/UserInfo.js b/vnext/src/ui/UserInfo.js index 6a394b86..5bcc2507 100644 --- a/vnext/src/ui/UserInfo.js +++ b/vnext/src/ui/UserInfo.js @@ -26,7 +26,7 @@ export default function UserInfo({ uname, onUpdate, children }) { onUpdate && onUpdate(response.data); setUser(response.data); } - }); + }).catch(console.log); return () => { isMounted = false; }; @@ -79,7 +79,6 @@ function Summary({ user }) { return ( <div className="msg-summary"> {presentItems.length > 0 && presentItems.reduce((prev, curr) => - // @ts-ignore [prev, ' ', curr])} </div> ); |