History

Prepare datamodel for multi-environment (#1765)

Julius Marminge committed 7 months ago

Commit b96308f1 parent 72b7f90121 files · +10206 −4969Browse files

Showing the changes to apps/web/src/components/PullRequestThreadDialog.tsx (1 of 121 files). Show all

Unified · Split

apps/web/src/components/PullRequestThreadDialog.tsx+7−3
@@ -1,4 +1,4 @@
1−import type { GitResolvePullRequestResult, ThreadId } from "@t3tools/contracts";
1+import type { EnvironmentId, GitResolvePullRequestResult, ThreadId } from "@t3tools/contracts";
22 import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
33 import { useDebouncedValue } from "@tanstack/react-pacer";
44 import { useCallback, useEffect, useMemo, useRef, useState } from "react";
@@ -24,6 +24,7 @@ import { Spinner } from "./ui/spinner"; · 19 unmodified lines
2424
2525 interface PullRequestThreadDialogProps {
2626 open: boolean;
27+ environmentId: EnvironmentId;
2728 threadId: ThreadId;
2829 cwd: string | null;
2930 initialReference: string | null;
@@ -33,6 +34,7 @@ interface PullRequestThreadDialogProps { · 3 unmodified lines
3334
3435 export function PullRequestThreadDialog({
3536 open,
37+ environmentId,
3638 threadId,
3739 cwd,
3840 initialReference,
@@ -72,6 +74,7 @@ export function PullRequestThreadDialog({ · 33 unmodified lines
7274 const parsedDebouncedReference = parsePullRequestReference(debouncedReference);
7375 const resolvePullRequestQuery = useQuery(
7476 gitResolvePullRequestQueryOptions({
77+ environmentId,
7578 cwd,
7679 reference: open ? parsedDebouncedReference : null,
7780 }),
@@ -83,13 +86,14 @@ export function PullRequestThreadDialog({ · 5 unmodified lines
8386 const cached = queryClient.getQueryData<GitResolvePullRequestResult>([
8487 "git",
8588 "pull-request",
89+ environmentId,
8690 cwd,
8791 parsedReference,
8892 ]);
8993 return cached?.pullRequest ?? null;
90− }, [cwd, parsedReference, queryClient]);
94+ }, [cwd, environmentId, parsedReference, queryClient]);
9195 const preparePullRequestThreadMutation = useMutation(
92− gitPreparePullRequestThreadMutationOptions({ cwd, queryClient }),
96+ gitPreparePullRequestThreadMutationOptions({ environmentId, cwd, queryClient }),
9397 );
9498
9599 const liveResolvedPullRequest =