mirror of https://github.com/perkeep/perkeep.git
Fix an intermittent JavaScript error during server push.
Change-Id: If942a4d79dc53619e52b205dd462d0fb8f44aeae
This commit is contained in:
parent
5e72b0f104
commit
a5f189ef0e
|
@ -361,10 +361,6 @@ camlistore.BlobItemContainer.prototype.search = function(callerConstraint,
|
||||||
|
|
||||||
this.connection_.search(JSON.stringify(query),
|
this.connection_.search(JSON.stringify(query),
|
||||||
goog.bind(this.searchDone_, this, callerConstraint, searchMode));
|
goog.bind(this.searchDone_, this, callerConstraint, searchMode));
|
||||||
|
|
||||||
if (searchMode == this.searchMode_.NEW) {
|
|
||||||
this.startSocketQuery_(callerConstraint);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
camlistore.BlobItemContainer.prototype.searchDone_ = function(constraint,
|
camlistore.BlobItemContainer.prototype.searchDone_ = function(constraint,
|
||||||
|
@ -373,6 +369,7 @@ camlistore.BlobItemContainer.prototype.searchDone_ = function(constraint,
|
||||||
if (searchMode == this.searchMode_.NEW) {
|
if (searchMode == this.searchMode_.NEW) {
|
||||||
this.resetChildren_();
|
this.resetChildren_();
|
||||||
this.itemCache_ = {};
|
this.itemCache_ = {};
|
||||||
|
this.startSocketQuery_(constraint);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!result.blobs || !result.blobs.length) {
|
if (!result.blobs || !result.blobs.length) {
|
||||||
|
@ -631,6 +628,7 @@ function(result, startIndex) {
|
||||||
// Remove any children we don't need anymore.
|
// Remove any children we don't need anymore.
|
||||||
var childCount = startIndex + result.blobs.length;
|
var childCount = startIndex + result.blobs.length;
|
||||||
while (this.getChildCount() > childCount) {
|
while (this.getChildCount() > childCount) {
|
||||||
|
this.itemCache_[this.getChildAt(childCount).getBlobRef()] = null;
|
||||||
this.removeChildAt(childCount, true);
|
this.removeChildAt(childCount, true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue