Fix an intermittent JavaScript error during server push.

Change-Id: If942a4d79dc53619e52b205dd462d0fb8f44aeae
This commit is contained in:
Aaron Boodman 2013-12-12 03:05:46 -08:00
parent 5e72b0f104
commit a5f189ef0e
1 changed files with 2 additions and 4 deletions

View File

@ -361,10 +361,6 @@ camlistore.BlobItemContainer.prototype.search = function(callerConstraint,
this.connection_.search(JSON.stringify(query),
goog.bind(this.searchDone_, this, callerConstraint, searchMode));
if (searchMode == this.searchMode_.NEW) {
this.startSocketQuery_(callerConstraint);
}
};
camlistore.BlobItemContainer.prototype.searchDone_ = function(constraint,
@ -373,6 +369,7 @@ camlistore.BlobItemContainer.prototype.searchDone_ = function(constraint,
if (searchMode == this.searchMode_.NEW) {
this.resetChildren_();
this.itemCache_ = {};
this.startSocketQuery_(constraint);
}
if (!result.blobs || !result.blobs.length) {
@ -631,6 +628,7 @@ function(result, startIndex) {
// Remove any children we don't need anymore.
var childCount = startIndex + result.blobs.length;
while (this.getChildCount() > childCount) {
this.itemCache_[this.getChildAt(childCount).getBlobRef()] = null;
this.removeChildAt(childCount, true);
}
};