1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-16 00:07:38 +00:00

Fix importvariables crash (#4593)

* Fixed issue: multi nonMacro imports broke everything

* Fixed issue: dead variables in import might linger
This commit is contained in:
Cameron Fischer
2020-04-23 04:10:52 -04:00
committed by GitHub
parent 1cc5c5e7f0
commit 2385bd978f
2 changed files with 59 additions and 1 deletions

View File

@@ -38,6 +38,8 @@ Compute the internal state of the widget
*/
ImportVariablesWidget.prototype.execute = function(tiddlerList) {
var widgetPointer = this;
// Got to flush all the accumulated variables
this.variables = new this.variablesConstructor();
// Get our parameters
this.filter = this.getAttribute("filter");
// Compute the filter
@@ -70,7 +72,14 @@ ImportVariablesWidget.prototype.execute = function(tiddlerList) {
widgetPointer.variables[key] = widget.variables[key];
});
} else {
widgetPointer.makeChildWidgets([node]);
widgetPointer.children = [widgetPointer.makeChildWidget(node)];
// No more regenerating children for
// this widget. If it needs to refresh,
// it'll do so along with the the whole
// importvariable tree.
if (widgetPointer != this) {
widgetPointer.makeChildWidgets = function(){};
}
widgetPointer = widgetPointer.children[0];
}
parseTreeNode = parseTreeNode.children && parseTreeNode.children[0];