Skip to content

Commit

Permalink
refactor(wab): Code component variants in model
Browse files Browse the repository at this point in the history
Change-Id: Id6655ca6b6a2bd4c1157c79ff7489234a1d9f7c8
GitOrigin-RevId: 2e500b7e0d750701d256bc8d0aa585bf31395745
  • Loading branch information
sarahsga authored and actions-user committed Dec 13, 2024
1 parent b24741c commit 3358b8d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions platform/wab/src/wab/client/components/VariantControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,11 @@ export const StyleVariantEditor = observer(function StyleVariantEditor_({
onDismiss?.();

if (
isCodeComponentVariant(variant) &&
variant.codeComponentVariantKeys?.length === 0
(isCodeComponentVariant(variant) &&
variant.codeComponentVariantKeys?.length === 0) ||
(isStyleVariant(variant) && variant.selectors?.length === 0)
) {
spawn(studioCtx.siteOps().removeVariant(component, variant));
return;
}

if (isStyleVariant(variant) && variant.selectors?.length === 0) {
spawn(studioCtx.siteOps().removeVariant(component, variant));
}
});
}
Expand Down

0 comments on commit 3358b8d

Please sign in to comment.