fix visual query from calling setupChartModel too many times.
@@ -249,6 +249,11 @@ export class BuildQueryComponent implements OnDestroy, OnChanges, OnInit {
autocompleteNoDataFound:boolean = false;
+ /**
+ * flag when the query engine is loaded
+ */
+ engineLoaded:boolean = false;
+
/**
* Constructs a {@code BuildQueryComponent}.
* private hiveService: HiveService, private sideNavService: SideNavService,
@@ -1135,7 +1140,7 @@ export class BuildQueryComponent implements OnDestroy, OnChanges, OnInit {
}
ngOnChanges(changes: SimpleChanges): void {
- if (changes.model && !changes.model.firstChange) {
+ if (changes.model && !changes.model.firstChange && this.engineLoaded) {
this.initModelAttributes();
// Setup the flowchart Model
this.setupFlowChartModel();
@@ -1183,6 +1188,7 @@ export class BuildQueryComponent implements OnDestroy, OnChanges, OnInit {
// Validate when the page loads
this.validate();
+ this.engineLoaded = true;
});
