mirror of
https://github.com/stablyai/orca.git
synced 2026-10-15 00:02:48 +00:00
Derive repo hook local editor visibility
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user