Skip to content

Commit 83414b4

Browse files
fixed warnings
1 parent 0ab33cb commit 83414b4

File tree

5 files changed

+22
-35
lines changed

5 files changed

+22
-35
lines changed

src/api/runs/getGraphRunByIdApi.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { fetchApiWithAuthRequest } from '../fetchApi';
22
import { endpoints } from '../endpoints';
33
import { httpMethods } from '../constants';
44
import { apiUrl } from '../apiUrl';
5-
import mockApi from '../mockApiData';
65

76
const getGraphRunByIdApi = ({
87
authenticationToken,

src/ui/layouts/pipelines/RunDetail/useService.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ import {
66
runPagesSelectors,
77
runSelectors,
88
} from '../../../../redux/selectors';
9-
import {
10-
useDispatch,
11-
useParams,
12-
useRequestOnMount,
13-
useSelector,
14-
} from '../../../hooks';
9+
import { useDispatch, useParams, useSelector } from '../../../hooks';
1510

1611
interface ServiceInterface {
1712
runId: TId;
@@ -44,6 +39,7 @@ export const useService = (): ServiceInterface => {
4439
);
4540
setIsMounted(true);
4641
}
42+
// eslint-disable-next-line react-hooks/exhaustive-deps
4743
}, [isMounted, setIsMounted]);
4844
// useRequestOnMount(() =>
4945
// runsActions.graphForRun({
@@ -68,11 +64,10 @@ export const useService = (): ServiceInterface => {
6864
// pipelineId,
6965
// }),
7066
// );
71-
72-
const fetching = useSelector(runPagesSelectors.fetching);
7367
const setFetching = (fetching: boolean) => {
7468
dispatch(runPagesActions.setFetching({ fetching }));
7569
};
70+
const fetching = useSelector(runPagesSelectors.fetching);
7671

7772
const billing = useSelector(billingSelectors.billingForRunId(id));
7873

src/ui/layouts/runs/RunDetail/useService.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@ import {
77
runPagesSelectors,
88
runSelectors,
99
} from '../../../../redux/selectors';
10-
import {
11-
useDispatch,
12-
useParams,
13-
useRequestOnMount,
14-
useSelector,
15-
} from '../../../hooks';
10+
import { useDispatch, useParams, useSelector } from '../../../hooks';
1611

1712
interface ServiceInterface {
1813
runId: TId;
@@ -50,6 +45,7 @@ export const useService = (): ServiceInterface => {
5045
);
5146
setIsMounted(true);
5247
}
48+
// eslint-disable-next-line react-hooks/exhaustive-deps
5349
}, [isMounted, setIsMounted]);
5450

5551
// useRequestOnMount(() =>

src/ui/layouts/stackComponents/RunDetail/useService.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@ import {
77
runPagesSelectors,
88
runSelectors,
99
} from '../../../../redux/selectors';
10-
import {
11-
useDispatch,
12-
useParams,
13-
useRequestOnMount,
14-
useSelector,
15-
} from '../../../hooks';
10+
import { useDispatch, useParams, useSelector } from '../../../hooks';
1611

1712
interface ServiceInterface {
1813
runId: TId;
@@ -51,6 +46,7 @@ export const useService = (): ServiceInterface => {
5146
);
5247
setIsMounted(true);
5348
}
49+
// eslint-disable-next-line react-hooks/exhaustive-deps
5450
}, [isMounted, setIsMounted]);
5551

5652
// useRequestOnMount(() =>

src/ui/layouts/stacks/RunDetail/useService.ts

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
import {
1010
useDispatch,
1111
useParams,
12-
useRequestOnMount,
12+
// useRequestOnMount,
1313
useSelector,
1414
} from '../../../hooks';
1515

@@ -38,19 +38,20 @@ export const useService = (): ServiceInterface => {
3838
// onFailure: () => setFetching(false),
3939
// }),
4040
// );
41-
// useEffect(() => {
42-
// if (!isMounted) {
43-
// setFetching(true);
44-
// dispatch(
45-
// runsActions.graphForRun({
46-
// runId: id,
47-
// onSuccess: () => setFetching(false),
48-
// onFailure: () => setFetching(false),
49-
// }),
50-
// );
51-
// setIsMounted(true);
52-
// }
53-
// }, [isMounted, setIsMounted]);
41+
useEffect(() => {
42+
if (!isMounted) {
43+
setFetching(true);
44+
dispatch(
45+
runsActions.graphForRun({
46+
runId: id,
47+
onSuccess: () => setFetching(false),
48+
onFailure: () => setFetching(false),
49+
}),
50+
);
51+
setIsMounted(true);
52+
}
53+
// eslint-disable-next-line react-hooks/exhaustive-deps
54+
}, [isMounted, setIsMounted]);
5455

5556
// useEffect(() => {
5657
// setFetching(true);

0 commit comments

Comments
 (0)