Skip to content

Commit 64f1062

Browse files
committed
feat: only show no results page when modal has valid query
1 parent 1c953fb commit 64f1062

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/search/SearchResultsView.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,9 @@ define(function (require, exports, module) {
570570
*/
571571
SearchResultsView.prototype._render = function () {
572572
let count = this._model.countFilesMatches();
573-
if (count.matches === 0) {
573+
if (count.matches === 0 && this._model.queryInfo) {
574+
// Only redirect to showNoResults() when the model has a valid query
575+
// (i.e. this is a real "no results" state, not a transient clear).
574576
this.showNoResults();
575577
return;
576578
}
@@ -833,6 +835,11 @@ define(function (require, exports, module) {
833835
this._$selectedRow = null;
834836
this._allChecked = false;
835837

838+
if (this._timeoutID) {
839+
window.clearTimeout(this._timeoutID);
840+
this._timeoutID = null;
841+
}
842+
836843
this._$table.empty();
837844
this._closePreviewEditor();
838845

0 commit comments

Comments
 (0)