Skip to content

Commit

Permalink
fix(project-deps): cleanup public state from parent component when re…
Browse files Browse the repository at this point in the history
…moving tpl from dependency upgrade

GitOrigin-RevId: 26e810b0e844273a26322f3d7913634361344c70
  • Loading branch information
IcaroG authored and actions-user committed Dec 2, 2024
1 parent cd6f772 commit c2a1d24
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions platform/wab/src/wab/shared/core/project-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import {
isPrivateState,
isStateUsedInExpr,
removeComponentState,
removeImplicitStatesAfterRemovingTplNode,
} from "@/wab/shared/core/states";
import { cloneMixin } from "@/wab/shared/core/styles";
import {
Expand Down Expand Up @@ -1073,7 +1074,11 @@ function upgradeProjectDep(
// the site for every tpl
const attachedTpls = getAllAttachedTpls(site);
const fixTpl = (tpl: TplNode, owner: Component | ArenaFrame) => {
// If the Tpl is not attached anymore, cleanup states and return
if (!attachedTpls.has(tpl)) {
if (isKnownComponent(owner)) {
removeImplicitStatesAfterRemovingTplNode(site, owner, tpl);
}
return;
}

Expand Down

0 comments on commit c2a1d24

Please sign in to comment.