Skip to content

Conversation

@idanlevi-wix
Copy link
Contributor

No description provided.

@idanlevi-wix idanlevi-wix merged commit 8b9ee0f into main Oct 26, 2025
1 check passed
@idanlevi-wix idanlevi-wix deleted the headless-modifiers branch October 26, 2025 09:08
Comment on lines +195 to +218
if (singleSelect) {
// Single select behavior: select the modifier, replacing any existing selection
selectedModifiers.set({
...currentSelectedModifiers,
[modifierGroupId]: [modifierId],
});
} else {
// Multi-select behavior: toggle the modifier
if (isModifierSelected) {
// Remove the modifier if it exists
const updatedModifierIds = groupModifierIds.filter(
(id) => id !== modifierId,
);
selectedModifiers.set({
...currentSelectedModifiers,
[modifierGroupId]: updatedModifierIds,
});
} else {
// Add the modifier to the existing selection
selectedModifiers.set({
...currentSelectedModifiers,
[modifierGroupId]: [...groupModifierIds, modifierId],
});
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to complicated, I'd at least separate the modifierIds to update and the set(...)

something like

const modifierIds = getUpdatedModifiers();
selectedModifiers.set({
            ...currentSelectedModifiers,
            [modifierGroupId]: modifierIds,
          });

Comment on lines +225 to +229
// Get selected modifier IDs for this group
const groupId = modifierGroup._id;
const groupSelectedModifierIds = groupId
? selectedModifiers[groupId] || []
: [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it better to move the logic to the service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants