diff --git a/server/camlistored/ui/blob_item_container_react.js b/server/camlistored/ui/blob_item_container_react.js index 2df1d1a08..6e8400bf3 100644 --- a/server/camlistored/ui/blob_item_container_react.js +++ b/server/camlistored/ui/blob_item_container_react.js @@ -138,9 +138,6 @@ cam.BlobItemContainerReact = React.createClass({ this.childProps_ = []; var results = this.props.searchSession.getCurrentResults(); - if (!results || !results.blobs || results.blobs.length == 0) { - return; - } var data = goog.array.map(results.blobs, function(blob) { return new cam.BlobItemReactData(blob.blob, results.description.meta); }); diff --git a/server/camlistored/ui/search_session.js b/server/camlistored/ui/search_session.js index a8be4270f..602cec7ed 100644 --- a/server/camlistored/ui/search_session.js +++ b/server/camlistored/ui/search_session.js @@ -76,6 +76,10 @@ cam.SearchSession.prototype.getQuery = function() { } // Returns all the data we currently have loaded. +// It is guaranteed to return the following properties: +// blobs // non-zero length +// description +// description.meta cam.SearchSession.prototype.getCurrentResults = function() { return this.data_; }; @@ -154,6 +158,9 @@ cam.SearchSession.prototype.searchDone_ = function(changeType, result) { this.data_.blobs = result.blobs; this.data_.description = result.description; } + if (!this.data_.blobs || this.data_.blobs.length == 0) { + this.resetData_(); + } if (result.continue) { this.continuation_ = this.getContinuation_(this.constructor.SEARCH_SESSION_CHANGE_TYPE.APPEND, result.continue);