diff --git a/src/renderer/src/components/settings/RepositoryHooksSection.tsx b/src/renderer/src/components/settings/RepositoryHooksSection.tsx index c6e09bf260c..485ab252e00 100644 --- a/src/renderer/src/components/settings/RepositoryHooksSection.tsx +++ b/src/renderer/src/components/settings/RepositoryHooksSection.tsx @@ -464,15 +464,7 @@ function ScriptEditor({ } }, [value]) - useEffect(() => { - // Why: when the repo or its persisted local script changes (e.g. switching repos), - // re-evaluate whether the local block should be visible by default. - if (value.length > 0) { - setShowLocal(true) - } - }, [value]) - - const showLocalEditor = showLocal || !hasShared + const showLocalEditor = showLocal || value.length > 0 || !hasShared const lineCount = value ? value.split('\n').length : 0 return (