aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-06-14 03:04:38 +0300
committereug-vs <eug-vs@keemail.me>2020-06-14 03:04:38 +0300
commitf338f879a08945056dc6d35d3bb333e7d6cb0840 (patch)
treebb7ecb7fd156f22ea576cbb337c830efb0060243 /src
parent3969face39ecc933b1cb9c7625be921d148552cb (diff)
downloadwhich-ui-f338f879a08945056dc6d35d3bb333e7d6cb0840.tar.gz
style: resolve eslint errors
Diffstat (limited to 'src')
-rw-r--r--src/Form/SignInForm.tsx10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Form/SignInForm.tsx b/src/Form/SignInForm.tsx
index 07e8f02..40352fe 100644
--- a/src/Form/SignInForm.tsx
+++ b/src/Form/SignInForm.tsx
@@ -24,7 +24,7 @@ const useStyles = makeStyles(theme => ({
const SignInForm: React.FC<PropTypes> = ({ setUser }) => {
const classes = useStyles();
- const inputRef = useRef<any>();
+ const inputRef = useRef<HTMLInputElement>();
const getUserProfile = name => {
get(`/users?name=${name}`).then(response => {
@@ -33,9 +33,11 @@ const SignInForm: React.FC<PropTypes> = ({ setUser }) => {
};
const onClick = () => {
- const value = inputRef.current.value;
- localStorage.setItem('user', value);
- getUserProfile(value);
+ const value = inputRef.current?.value;
+ if (value) {
+ localStorage.setItem('user', value);
+ getUserProfile(value);
+ }
};
if (localStorage.getItem('user') !== null) {