From fe82b4e0ef835e6921575f1927174479bea7f777 Mon Sep 17 00:00:00 2001 From: ilyayudovin Date: Tue, 17 Nov 2020 15:49:05 +0300 Subject: fix: clear eslint errors --- src/containers/Profile/ProfileInfo.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/containers/Profile/ProfileInfo.tsx') diff --git a/src/containers/Profile/ProfileInfo.tsx b/src/containers/Profile/ProfileInfo.tsx index 4c9f17e..777a779 100644 --- a/src/containers/Profile/ProfileInfo.tsx +++ b/src/containers/Profile/ProfileInfo.tsx @@ -112,21 +112,23 @@ const ProfileInfo: React.FC = ({ const dateSince = useMemo(() => formatDate(userInfo?.createdAt), [userInfo]); const handleUpdateAvatar = useCallback(async (file: File) => { - if (user) uploadFileToS3(file, 0.8, setProgress) - .then(avatarUrl => patch(`/users/${user._id}`, { avatarUrl })) - .then(response => setUserInfo(response.data)) - .then(() => setProgress(0)); + if (user) { + uploadFileToS3(file, 0.8, setProgress) + .then(avatarUrl => patch(`/users/${user._id}`, { avatarUrl })) + .then(response => setUserInfo(response.data)) + .then(() => setProgress(0)); + } }, [user, setUserInfo]); - const handleCropAvatar = useCallback( async(file: File) => { + const handleCropAvatar = useCallback(async (file: File) => { const imageSrc = URL.createObjectURL(file); setAvatarToCrop(imageSrc); - },[]); + }, []); return (
{ - avatarToCrop && + avatarToCrop && } { !userInfo -- cgit v1.2.3