Skip to content

Commit 55b9838

Browse files
Merge pull request #42 from OpenDTU-App/26-app-update-hint-might-only-show-up-once-a-device-is-connected
2 parents a830a97 + a46d5d3 commit 55b9838

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/github/FetchHandler.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ import {
99
setReleases,
1010
} from '@/slices/github';
1111

12-
import useDeviceIndex from '@/hooks/useDeviceIndex';
13-
12+
// import useDeviceIndex from '@/hooks/useDeviceIndex';
1413
import ago from '@/utils/ago';
1514

1615
import {
@@ -22,11 +21,11 @@ import { useAppDispatch, useAppSelector } from '@/store';
2221

2322
const FetchHandler: FC = () => {
2423
const dispatch = useAppDispatch();
25-
const index = useDeviceIndex();
24+
// const index = useDeviceIndex();
2625

27-
const isConnected = useAppSelector(state =>
26+
/*const isConnected = useAppSelector(state =>
2827
index === null ? undefined : state.opendtu.dtuStates[index]?.isConnected,
29-
);
28+
);*/
3029
const latestReleaseRefetchOk = useAppSelector(state =>
3130
state.github.latestRelease.lastUpdate
3231
? ago(state.github.latestRelease.lastUpdate) > 1000 * 60 * 10 // 10 minutes
@@ -52,7 +51,7 @@ const FetchHandler: FC = () => {
5251
const githubApi = useGithub();
5352

5453
useEffect(() => {
55-
if (!isConnected || !githubApi) return;
54+
if (/*!isConnected || */ !githubApi) return;
5655

5756
console.log('fetching latest github data');
5857

@@ -98,7 +97,7 @@ const FetchHandler: FC = () => {
9897
func();
9998
}, [
10099
dispatch,
101-
isConnected,
100+
// isConnected,
102101
githubApi,
103102
latestReleaseRefetchOk,
104103
allReleasesRefetchOk,

0 commit comments

Comments
 (0)