mirror of https://github.com/perkeep/perkeep.git
Merge "UI: reset search session data if empty result."
This commit is contained in:
commit
3d7c093ac8
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue