aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/ui
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-11-08 00:17:14 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:58 +0300
commitabe8e7bc26906929914834dbaf38a793bcbb4f78 (patch)
tree677b41bc2b3d2f78b26392dbf4bb7d7dddb603bb /vnext/src/ui
parentee4f45f13f652d8807c2617f24aa167243076b5e (diff)
ESLint: switch to `@typescript-eslint/parser`
* JS version of the `no-floating-promise` rule sucks :(
Diffstat (limited to 'vnext/src/ui')
-rw-r--r--vnext/src/ui/Chat.js2
-rw-r--r--vnext/src/ui/Contacts.js2
-rw-r--r--vnext/src/ui/Icon.js1
-rw-r--r--vnext/src/ui/MessageInput.js24
-rw-r--r--vnext/src/ui/Settings.js10
-rw-r--r--vnext/src/ui/UserInfo.js3
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>
);