Commit 4bbe874b by asranov0003

fix: isfetched

parent 51e31a1b
...@@ -37,20 +37,15 @@ const Header: React.FC = () => { ...@@ -37,20 +37,15 @@ const Header: React.FC = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const dispatch = useAppDispatch(); const dispatch = useAppDispatch();
const { session } = useAppSelector((state: RootState) => state.account); const { session } = useAppSelector((state: RootState) => state.account);
const { devices, selectedDevice, isFetched } = useAppSelector( const { devices, selectedDevice } = useAppSelector(
(state: RootState) => state.device (state: RootState) => state.device
); );
useEffect(() => { useEffect(() => {
dispatch(fetchDevices());
dispatch(accountSession()); dispatch(accountSession());
}, [dispatch]); }, [dispatch]);
useEffect(() => {
if (!isFetched) {
dispatch(fetchDevices());
}
}, [dispatch, isFetched]);
const handleOutsideClick = (e: MouseEvent) => { const handleOutsideClick = (e: MouseEvent) => {
if (sidebarRef.current && !sidebarRef.current.contains(e.target as Node)) { if (sidebarRef.current && !sidebarRef.current.contains(e.target as Node)) {
setIsSidebarOpen(false); setIsSidebarOpen(false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment