diff --git a/src/renderer/src/components/LinearItemDrawer.tsx b/src/renderer/src/components/LinearItemDrawer.tsx index 0e8e99e7585..e8dc2c36d7e 100644 --- a/src/renderer/src/components/LinearItemDrawer.tsx +++ b/src/renderer/src/components/LinearItemDrawer.tsx @@ -955,11 +955,10 @@ export function LinearIssueCommentFooter({ const textareaRef = useRef(null) const mountedRef = useRef(true) - useEffect(() => { - mountedRef.current = true - return () => { - mountedRef.current = false - } + const handleFooterRef = useCallback((node: HTMLDivElement | null): void => { + // Why: comment submission can resolve after the footer unmounts; the root + // ref keeps that completion from writing stale local state without an Effect. + mountedRef.current = node !== null }, []) const autoGrow = useCallback(() => { @@ -1016,7 +1015,10 @@ export function LinearIssueCommentFooter({ if (variant === 'linear-page') { return ( -
+