Remove diagnostics bundle ref mirror effect (#3176)

This commit is contained in:
Neil 2026-05-30 12:25:42 -07:00 committed by GitHub
parent 57e87b006e
commit 962395e4ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 4 deletions

View File

@ -52,10 +52,6 @@ export function PrivacyDiagnosticsSection(): React.JSX.Element {
}
}, [])
useEffect(() => {
activeBundleSubmissionIdRef.current = bundle?.bundleSubmissionId ?? null
}, [bundle])
const handleOpenFolder = useCallback(async (): Promise<void> => {
try {
await window.api.diagnostics.openTraceFolder()
@ -91,6 +87,9 @@ export function PrivacyDiagnosticsSection(): React.JSX.Element {
await window.api.diagnostics.discardBundlePreview(nextBundle.bundleSubmissionId)
return
}
// Why: unmount cleanup may run before a passive ref mirror would fire;
// keep the retained preview id in sync at the creation/clear sites.
activeBundleSubmissionIdRef.current = nextBundle.bundleSubmissionId
setBundle(nextBundle)
setPreviewOpened(false)
setTicketId(null)