Commit 6fd49619 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Simplifica omisión de peticiones de charts

parent 9a3fba0c
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -330,18 +330,21 @@ define([

				addedToQueryDfds.push(dfd);

				if (i !== 0) {
					var prevDfd = addedToQueryDfds[i - 1];
					prevDfd.then(lang.hitch(this, this._continueBuildQueryAndRequestData, dfd, cat));
				} else {
					this._continueBuildQueryAndRequestData(dfd, cat);
				}
			}

			addedToQueryDfds[addedToQueryDfds.length - 1].then(lang.hitch(this, function() {
				if (i === definitionIds.length - 1) {
					dfd.then(lang.hitch(this, function() {

						this._dataRequestInProgress = false;
					}));
				}

				if (i === 0) {
					this._continueBuildQueryAndRequestData(dfd, cat);
					continue;
				}

				var prevDfd = addedToQueryDfds[i - 1];
				prevDfd.then(lang.hitch(this, this._continueBuildQueryAndRequestData, dfd, cat));
			}
		},

		_continueBuildQueryAndRequestData: function(dfd, cat) {