Derive repo hook local editor visibility (#3093)

This commit is contained in:
Neil
2026-05-30 20:10:53 -07:00
committed by GitHub
parent 3e32619cfe
commit 59091a8dc2
@@ -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 (