|
1 | 1 | import type { EnvironmentId, PullRequestRef, PullRequestReviewGuide } from "@t3tools/contracts"; |
2 | | -import { useEffect, useEffectEvent, useMemo, useRef, useState, type ReactNode } from "react"; |
| 2 | +import { useEffect, useEffectEvent, useRef, useState, type ReactNode } from "react"; |
3 | 3 |
|
4 | 4 | import { createPullRequestDiffFileContentsLoader } from "~/lib/diffFileContents"; |
5 | 5 | import { isEditableFocused } from "~/lib/editableFocus"; |
@@ -52,24 +52,20 @@ export function GuideTour({ |
52 | 52 | const position = Math.max(Math.min(tour.position, stopCount - 1), 0); |
53 | 53 | const stop = guide.stops[position] ?? null; |
54 | 54 |
|
55 | | - const wantedPaths = useMemo(() => (stop === null ? [] : stopFilePaths(stop)), [stop]); |
| 55 | + const wantedPaths = stop === null ? [] : stopFilePaths(stop); |
56 | 56 | const diff = useGuideDiffFiles({ |
57 | 57 | environmentId, |
58 | 58 | reference, |
59 | 59 | headSha: guide.headSha, |
60 | 60 | wantedPaths, |
61 | 61 | }); |
62 | 62 | const getDiffFileContents = useAtomCommand(pullRequestEnvironment.diffFileContents); |
63 | | - const loadDiffFiles = useMemo( |
64 | | - () => |
65 | | - createPullRequestDiffFileContentsLoader(getDiffFileContents, { |
66 | | - environmentId, |
67 | | - reference, |
68 | | - commit: null, |
69 | | - cacheKey: `pull-request-guide:${key}`, |
70 | | - }), |
71 | | - [environmentId, getDiffFileContents, key, reference], |
72 | | - ); |
| 63 | + const loadDiffFiles = createPullRequestDiffFileContentsLoader(getDiffFileContents, { |
| 64 | + environmentId, |
| 65 | + reference, |
| 66 | + commit: null, |
| 67 | + cacheKey: `pull-request-guide:${key}`, |
| 68 | + }); |
73 | 69 |
|
74 | 70 | const scrollRef = useRef<HTMLDivElement>(null); |
75 | 71 | const goTo = (next: number) => { |
|
0 commit comments