Commit 4bbe874b by asranov0003

fix: isfetched

parent 51e31a1b
......@@ -37,20 +37,15 @@ const Header: React.FC = () => {
const { t } = useTranslation();
const dispatch = useAppDispatch();
const { session } = useAppSelector((state: RootState) => state.account);
const { devices, selectedDevice, isFetched } = useAppSelector(
const { devices, selectedDevice } = useAppSelector(
(state: RootState) => state.device
);
useEffect(() => {
dispatch(fetchDevices());
dispatch(accountSession());
}, [dispatch]);
useEffect(() => {
if (!isFetched) {
dispatch(fetchDevices());
}
}, [dispatch, isFetched]);
const handleOutsideClick = (e: MouseEvent) => {
if (sidebarRef.current && !sidebarRef.current.contains(e.target as Node)) {
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