From aeb137a696e42afc2326a393969dc187c62899f6 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Tue, 14 Jul 2026 03:09:30 +0800 Subject: [PATCH] Guard async input focus after unmount Skip focusing when the config read completes after InputBox has unmounted. This prevents a null-ref exception without changing mounted behavior. --- src/components/InputBox/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/InputBox/index.jsx b/src/components/InputBox/index.jsx index d50f95f2..e2252dad 100644 --- a/src/components/InputBox/index.jsx +++ b/src/components/InputBox/index.jsx @@ -87,7 +87,7 @@ export function InputBox({ onSubmit, enabled, postMessage, reverseResizeDir }) { useEffect(() => { if (enabled) getUserConfig().then((config) => { - if (config.focusAfterAnswer) inputRef.current.focus() + if (config.focusAfterAnswer) inputRef.current?.focus() }) }, [enabled])