From 71acbc9791ad42f99757feb9ed03e208fd09aa70 Mon Sep 17 00:00:00 2001
From: Vitaly Takmazov
Date: Fri, 19 May 2023 02:39:47 +0300
Subject: Fix linter warnings
---
vnext/src/api/index.js | 8 --------
vnext/src/ui/Avatar.js | 1 -
vnext/src/ui/Chat.js | 1 -
vnext/src/ui/Contact.js | 1 -
vnext/src/ui/Icon.js | 1 -
vnext/src/ui/Login.js | 1 -
vnext/src/ui/Message.js | 2 --
vnext/src/ui/MessageInput.js | 2 --
vnext/src/ui/Settings.js | 38 ++++++++++++++++++--------------------
vnext/src/ui/Thread.js | 5 ++---
vnext/src/ui/UploadButton.js | 1 -
vnext/src/ui/UserInfo.js | 3 ---
vnext/src/ui/Users.js | 1 -
vnext/src/ui/VisitorContext.js | 1 -
vnext/src/utils/embed.js | 5 -----
15 files changed, 20 insertions(+), 51 deletions(-)
(limited to 'vnext/src')
diff --git a/vnext/src/api/index.js b/vnext/src/api/index.js
index 2af6c867..ef753eaf 100644
--- a/vnext/src/api/index.js
+++ b/vnext/src/api/index.js
@@ -87,7 +87,6 @@ client.interceptors.request.use(config => {
/**
* fetch my info
- *
* @param {string} username
* @param {string} password
* @returns {Promise} me object
@@ -184,7 +183,6 @@ export function comment(mid, rid, body, attach) {
}
/**
* Edit message
- *
* @param {number} mid
* @param {number} rid
* @param {string?} body
@@ -198,7 +196,6 @@ export function update(mid, rid, body) {
}
/**
* Update user avatar
- *
* @param {string} newAvatar
*/
export function updateAvatar(newAvatar) {
@@ -247,7 +244,6 @@ let profileCache = {};
/**
* Fetch user profile
- *
* @param {string} profileUrl User profile URL
*/
export function fetchUserUri(profileUrl) {
@@ -283,7 +279,6 @@ export function fetchUserUri(profileUrl) {
/**
* Fetch Tweet content
- *
* @param {string} url Tweet URL
* @returns {Promise} HTML content
*/
@@ -300,7 +295,6 @@ export function fetchUserUri(profileUrl) {
/**
* Checks if HTTP error code is redirection code
- *
* @param {number} code HTTP error code
* @returns {boolean} is HTTP request redirected or not
*/
@@ -310,7 +304,6 @@ function isHttpRedirected(code = 200) {
/**
* Checks if HTTP error code is successful code
- *
* @param {number} code HTTP error code
* @returns {boolean} is HTTP request successful or not
*/
@@ -320,7 +313,6 @@ function isHttpSuccessful(code = 200) {
/**
* Resolves shortened url to actual one
- *
* @param {string} url URL to resolve
* @returns {Promise} full URL
*/
diff --git a/vnext/src/ui/Avatar.js b/vnext/src/ui/Avatar.js
index 0de225b2..9d93521f 100644
--- a/vnext/src/ui/Avatar.js
+++ b/vnext/src/ui/Avatar.js
@@ -13,7 +13,6 @@ import Icon from './Icon';
/**
* Avatar component
- *
* @param {AvatarProps} props
*/
function Avatar({ user, style, link, children }) {
diff --git a/vnext/src/ui/Chat.js b/vnext/src/ui/Chat.js
index 392b12a0..4fdeaac7 100644
--- a/vnext/src/ui/Chat.js
+++ b/vnext/src/ui/Chat.js
@@ -21,7 +21,6 @@ import { Helmet } from 'react-helmet';
/**
* Chat component
- *
* @param {ChatProps} props
*/
export default function Chat(props) {
diff --git a/vnext/src/ui/Contact.js b/vnext/src/ui/Contact.js
index a0d32e84..75c80332 100644
--- a/vnext/src/ui/Contact.js
+++ b/vnext/src/ui/Contact.js
@@ -10,7 +10,6 @@ import Avatar from './Avatar';
/**
* Contact component
- *
* @param {ContactProps} props
*/
function Contact({ user, style }) {
diff --git a/vnext/src/ui/Icon.js b/vnext/src/ui/Icon.js
index a9cd8a95..6d10df16 100644
--- a/vnext/src/ui/Icon.js
+++ b/vnext/src/ui/Icon.js
@@ -13,7 +13,6 @@ import evilIcons from 'evil-icons/assets/sprite.svg';
/**
* Icon inner component
- *
* @param {IconProps} props - icon props
*/
function IconElement(props) {
diff --git a/vnext/src/ui/Login.js b/vnext/src/ui/Login.js
index 58d1a16b..73da49c8 100644
--- a/vnext/src/ui/Login.js
+++ b/vnext/src/ui/Login.js
@@ -16,7 +16,6 @@ import { useVisitor } from './VisitorContext';
/**
* Login page
- *
* @param {LoginProps} props
*/
function Login({ onAuth }) {
diff --git a/vnext/src/ui/Message.js b/vnext/src/ui/Message.js
index 595d2178..c5ad175d 100644
--- a/vnext/src/ui/Message.js
+++ b/vnext/src/ui/Message.js
@@ -28,7 +28,6 @@ import { useVisitor } from './VisitorContext';
/**
* Message component
- *
* @param {React.PropsWithChildren<{}> & MessageProps} props props
*/
export default function Message({ data, isThread, onToggleSubscription, children }) {
@@ -156,7 +155,6 @@ function MessageContainer({ isCode, data }) {
/**
* Tags component
- *
* @param {{user: import('../client').User, data: string[]}} props props
*/
function Tags({ data, user }) {
diff --git a/vnext/src/ui/MessageInput.js b/vnext/src/ui/MessageInput.js
index de4edc7f..3d24e728 100644
--- a/vnext/src/ui/MessageInput.js
+++ b/vnext/src/ui/MessageInput.js
@@ -9,7 +9,6 @@ import toast from 'react-hot-toast';
/**
* StackOverflow-driven development: https://stackoverflow.com/a/10158364/1097384
- *
* @param {HTMLTextAreaElement & {createTextRange?: Function}} el element
*/
function moveCaretToEnd(el) {
@@ -37,7 +36,6 @@ function moveCaretToEnd(el) {
/**
* MessageInput
- *
* @param {React.ComponentProps & MessageInputProps} props props
*/
export default function MessageInput({ text, rows, placeholder, onSend }) {
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: '' };
}
- 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 (
) : (
- To connect Telegram account: send any text message to @Juick_bot
-
- )}
+ To connect Telegram account: send any text message to @Juick_bot
+
+ )}
{
visitor.jids && (
>
}
@@ -228,19 +226,19 @@ export default function Settings({ onChange }) {
) : (
- Cross-posting to Facebook:
-
-
-
-
- )}
+ Cross-posting to Facebook:
+
+
+
+
+ )}