| | |
| | | |
| | | const [unreadCount, setUnreadCount] = useState(0); |
| | | useEffect(() => { |
| | | // const timer = setInterval(() => { |
| | | // getUnreadCount().then((res: any) => { |
| | | // setUnreadCount(res.data || 0); |
| | | // }); |
| | | // }, 1000 * 5) |
| | | const timer = setInterval(() => { |
| | | getUnreadCount().then((res: any) => { |
| | | setUnreadCount(res.data || 0); |
| | | }); |
| | | }, 1000 * 5) |
| | | |
| | | // return () => clearInterval(timer); |
| | | return () => clearInterval(timer); |
| | | }, []); |
| | | |
| | | |
| | | const onMenuClick = async () => { |
| | | await outLogin(); |
| | | localStorage.clear(); |
| | | history.push('/login'); |
| | | flushSync(() => { |
| | | setInitialState((s) => ({ ...s, currentUser: undefined })); |
| | | }); |