mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-15 13:58:20 +00:00
fix: seed additive studio selection groups
This commit is contained in:
committed by
Miguel Ángel
parent
fa501b4830
commit
7f275f76f9
@@ -393,6 +393,14 @@ function replaceDomEditGroupSelection(
|
||||
return replaced ? nextGroup : [...group, selection];
|
||||
}
|
||||
|
||||
function seedDomEditGroupWithSelection(
|
||||
group: DomEditSelection[],
|
||||
selection: DomEditSelection | null,
|
||||
): DomEditSelection[] {
|
||||
if (!selection || domEditSelectionInGroup(group, selection)) return group;
|
||||
return [selection, ...group];
|
||||
}
|
||||
|
||||
// ── Ask Agent Modal ──
|
||||
|
||||
function AskAgentModal({
|
||||
@@ -1582,15 +1590,17 @@ export function StudioApp() {
|
||||
return;
|
||||
}
|
||||
|
||||
const currentGroup = domEditGroupSelectionsRef.current;
|
||||
const isAdditiveSelection = Boolean(options?.additive);
|
||||
const currentSelection = domEditSelectionRef.current;
|
||||
const currentGroup = isAdditiveSelection
|
||||
? seedDomEditGroupWithSelection(domEditGroupSelectionsRef.current, currentSelection)
|
||||
: domEditGroupSelectionsRef.current;
|
||||
const wasInGroup = domEditSelectionInGroup(currentGroup, selection);
|
||||
const nextGroup = options?.preserveGroup
|
||||
? replaceDomEditGroupSelection(currentGroup, selection)
|
||||
: isAdditiveSelection
|
||||
? toggleDomEditGroupSelection(currentGroup, selection)
|
||||
: [selection];
|
||||
const currentSelection = domEditSelectionRef.current;
|
||||
const nextSelection = options?.preserveGroup
|
||||
? selection
|
||||
: isAdditiveSelection && wasInGroup
|
||||
|
||||
Reference in New Issue
Block a user