Skip to content
TypeScript

fix(web): open thread picker for unsent drafts (#15436)

mariac8d7d50a7379
diff --git a/apps/web/src/components/pullRequest/PullRequestThreadLinks.tsx b/apps/web/src/components/pullRequest/PullRequestThreadLinks.tsx
index ed692a81370..0b168afc986 100644
--- a/apps/web/src/components/pullRequest/PullRequestThreadLinks.tsx
+++ b/apps/web/src/components/pullRequest/PullRequestThreadLinks.tsx
@@ -50,8 +50,8 @@ function EnabledPullRequestThreadLinks({
onPickerOpenChange,
}: PullRequestThreadLinksProps) {
const parsed = parseChangeRequestUrl(url);
- const currentThreadRef = threadRef?.environmentId === environmentId ? threadRef : null;
- const thread = useThreadShell(currentThreadRef);
+ const thread = useThreadShell(threadRef?.environmentId === environmentId ? threadRef : null);
+ const currentThreadRef = thread === null ? null : threadRef;
const linking = usePullRequestLinking(environmentId);
const linkedHere = linking.isLinked(thread, url);
const relations = useEnvironmentQuery(