fix review relink guard lifecycle

This commit is contained in:
Brennan Benson
2026-08-27 18:26:11 -07:00
parent 9d9d3116ae
commit 43c00dcdae
@@ -1,4 +1,4 @@
import { useCallback, useRef } from 'react'
import { useCallback, useLayoutEffect, useRef } from 'react'
import type { ChecksPanelCheckAndReviewActionsInput } from './check-and-review-action-dependencies'
type RefreshLinkedGitHubPullRequest = (linkedPRNumber: number) => Promise<void>
@@ -39,8 +39,10 @@ export function useChecksPanelReviewLinkActions(
const linkedGitLabMRRef = useRef(linkedGitLabMR)
const reviewLinkScopeKeyRef = useRef(reviewLinkScopeKey)
const reviewLinkActionGenerationRef = useRef(0)
linkedGitLabMRRef.current = linkedGitLabMR
reviewLinkScopeKeyRef.current = reviewLinkScopeKey
useLayoutEffect(() => {
linkedGitLabMRRef.current = linkedGitLabMR
reviewLinkScopeKeyRef.current = reviewLinkScopeKey
}, [linkedGitLabMR, reviewLinkScopeKey])
const handleUnlinkReview = useCallback(() => {
if (!activeWorktreeId || !activeWorktree || !activeReview) {