Skip to content

Commit

Permalink
fix: more html elements should not close insert panel
Browse files Browse the repository at this point in the history
Change-Id: Ic82a62ac4a69b5c3d3b49f0d485248f7bf6d2846
GitOrigin-RevId: 4e15eee53f14e0a1606f1985e591820c78791e85
  • Loading branch information
jaslong authored and actions-user committed Dec 16, 2024
1 parent 60e5c3e commit 67d7a74
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@ const AddDrawerContent = observer(function AddDrawerContent(props: {
return;
}

let tplNode: TplNode | null = null;
switch (item.type) {
case AddItemType.tpl:
case AddItemType.plume: {
Expand All @@ -419,14 +418,15 @@ const AddDrawerContent = observer(function AddDrawerContent(props: {
) {
studioCtx.showPresetsModal(component);
} else {
tplNode = await studioCtx.tryInsertTplItem(item);
onInserted(item, await studioCtx.tryInsertTplItem(item));
}
break;
}
case AddItemType.frame: {
await studioCtx.changeUnsafe(() => {
item.onInsert(studioCtx);
});
onInserted(item, null);
break;
}
case AddItemType.installable: {
Expand All @@ -443,6 +443,7 @@ const AddDrawerContent = observer(function AddDrawerContent(props: {
}
});
notifiyInstallableSuccess(item.label);
onInserted(item, null);
} catch (error) {
notifiyInstallableFailure(item.label, (error as any).message);
}
Expand All @@ -463,8 +464,6 @@ const AddDrawerContent = observer(function AddDrawerContent(props: {
break;
}
}

onInserted(item, tplNode);
};

function cycleSection(step: 1 | -1) {
Expand Down

0 comments on commit 67d7a74

Please sign in to comment.