mirror of
https://github.com/stablyai/orca.git
synced 2026-10-23 08:03:39 +00:00
fix(composer): restore project group reset effect
Revert read-side mask back to the merge-base state clear so a momentarily unavailable host permanently drops the folder group instead of silently retargeting Create when the host reappears.
This commit is contained in:
@@ -131,11 +131,15 @@ export function useComposerInitialTargetState(input: ComposerInitialTargetStateI
|
||||
[actionableHostIds, projectGroups, selectedProjectGroupId]
|
||||
)
|
||||
|
||||
const effectiveSelectedProjectGroupId = selectedProjectGroup ? selectedProjectGroupId : null
|
||||
useEffect(() => {
|
||||
if (selectedProjectGroupId && !selectedProjectGroup) {
|
||||
setSelectedProjectGroupId(null)
|
||||
}
|
||||
}, [selectedProjectGroup, selectedProjectGroupId])
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
effectiveSelectedProjectGroupId ||
|
||||
selectedProjectGroupId ||
|
||||
!initialFolderProjectGroupId ||
|
||||
initialProjectGroupAppliedRef.current
|
||||
) {
|
||||
@@ -150,12 +154,7 @@ export function useComposerInitialTargetState(input: ComposerInitialTargetStateI
|
||||
initialProjectGroupAppliedRef.current = true
|
||||
setSelectedProjectGroupId(nextGroup.id)
|
||||
}
|
||||
}, [
|
||||
actionableHostIds,
|
||||
effectiveSelectedProjectGroupId,
|
||||
initialFolderProjectGroupId,
|
||||
projectGroups
|
||||
])
|
||||
}, [actionableHostIds, initialFolderProjectGroupId, projectGroups, selectedProjectGroupId])
|
||||
|
||||
return {
|
||||
draftRepoId,
|
||||
@@ -173,7 +172,7 @@ export function useComposerInitialTargetState(input: ComposerInitialTargetStateI
|
||||
setSelectedProjectHostSetupOverrideId,
|
||||
initialFolderProjectGroupId,
|
||||
initialFolderProjectGroup,
|
||||
selectedProjectGroupId: effectiveSelectedProjectGroupId,
|
||||
selectedProjectGroupId,
|
||||
setSelectedProjectGroupId,
|
||||
initialProjectGroupAppliedRef,
|
||||
projectError,
|
||||
|
||||
Reference in New Issue
Block a user