mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-27 21:48:27 +00:00
fix: id widgets by type index to prevent erasing memory in some cases
This commit is contained in:
parent
b5720355f9
commit
6a2486d9f2
@ -53,10 +53,12 @@ export function transpiler(input, options = {}) {
|
|||||||
return this.replace(sliderWithLocation(node));
|
return this.replace(sliderWithLocation(node));
|
||||||
}
|
}
|
||||||
if (isWidgetMethod(node)) {
|
if (isWidgetMethod(node)) {
|
||||||
|
const type = node.callee.property.name;
|
||||||
|
const index = widgets.filter((w) => w.type === type).length;
|
||||||
const widgetConfig = {
|
const widgetConfig = {
|
||||||
to: node.end,
|
to: node.end,
|
||||||
index: widgets.length,
|
index,
|
||||||
type: node.callee.property.name,
|
type,
|
||||||
};
|
};
|
||||||
emitWidgets && widgets.push(widgetConfig);
|
emitWidgets && widgets.push(widgetConfig);
|
||||||
return this.replace(widgetWithLocation(node, widgetConfig));
|
return this.replace(widgetWithLocation(node, widgetConfig));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user