From 3358b8d471f4210281e78ea2dba631d244ee19d4 Mon Sep 17 00:00:00 2001 From: sarah Date: Mon, 9 Dec 2024 14:28:03 +0500 Subject: [PATCH] refactor(wab): Code component variants in model Change-Id: Id6655ca6b6a2bd4c1157c79ff7489234a1d9f7c8 GitOrigin-RevId: 2e500b7e0d750701d256bc8d0aa585bf31395745 --- .../wab/src/wab/client/components/VariantControls.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/platform/wab/src/wab/client/components/VariantControls.tsx b/platform/wab/src/wab/client/components/VariantControls.tsx index 66b42d0d2e9..2ffb0736042 100644 --- a/platform/wab/src/wab/client/components/VariantControls.tsx +++ b/platform/wab/src/wab/client/components/VariantControls.tsx @@ -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)); } }); }