diff --git a/src/components/Auth/AuthForm.tsx b/src/components/Auth/AuthForm.tsx
index 75ce643..b110abb 100644
--- a/src/components/Auth/AuthForm.tsx
+++ b/src/components/Auth/AuthForm.tsx
@@ -33,10 +33,10 @@ const AuthForm: React.FC = () => {
if (error.response) {
switch (error.response.status) {
case 404:
- toast({ title: 'User not found in a system.', status: 'error' });
+ toast({ title: 'User not found in a system.', status: 'error', duration: 2000 });
break;
case 401:
- toast({ title: 'Invalid password.', status: 'error' });
+ toast({ title: 'Invalid password.', status: 'error', duration: 2000 });
break;
default:
handleError(error);
diff --git a/src/components/Header/User/UserInfo.tsx b/src/components/Header/User/UserInfo.tsx
index fd14f1c..ab3da2f 100644
--- a/src/components/Header/User/UserInfo.tsx
+++ b/src/components/Header/User/UserInfo.tsx
@@ -13,6 +13,7 @@ import {
Text,
Link,
useToast,
+ Skeleton,
} from '@chakra-ui/react';
import { MdSettings, MdExitToApp } from 'react-icons/md';
import { observer } from 'mobx-react';
@@ -20,7 +21,7 @@ import { useRootStore } from '../../../hooks/useRootStore';
import { useHistory } from 'react-router-dom';
const UserInfo: React.FC = () => {
- const { authStore } = useRootStore();
+ const { authStore, userStore } = useRootStore();
const history = useHistory();
const toast = useToast();
@@ -34,6 +35,10 @@ const UserInfo: React.FC = () => {
}
};
+ if (userStore.me === null) {
+ return ;
+ }
+
return (