From 59091a8dc27e5233dbd9d3ac476aad6c33e14470 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sat, 30 May 2026 20:10:53 -0700 Subject: [PATCH] Derive repo hook local editor visibility (#3093) --- .../src/components/settings/RepositoryHooksSection.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/renderer/src/components/settings/RepositoryHooksSection.tsx b/src/renderer/src/components/settings/RepositoryHooksSection.tsx index 6d3565c41..6fd895be5 100644 --- a/src/renderer/src/components/settings/RepositoryHooksSection.tsx +++ b/src/renderer/src/components/settings/RepositoryHooksSection.tsx @@ -463,15 +463,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 (