Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: chrome/browser/resources/md_bookmarks/reducers.js

Issue 2972963003: MD Bookmarks: Prevent flash of folder contents when changing search term (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/types.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_bookmarks/reducers.js
diff --git a/chrome/browser/resources/md_bookmarks/reducers.js b/chrome/browser/resources/md_bookmarks/reducers.js
index 8337e5767457d7ca3e454c989b9b6cc528a07720..7154b83d59b3b23fe4166159cadfe7707b09b914 100644
--- a/chrome/browser/resources/md_bookmarks/reducers.js
+++ b/chrome/browser/resources/md_bookmarks/reducers.js
@@ -118,7 +118,7 @@ cr.define('bookmarks', function() {
return {
term: action.term,
inProgress: true,
- results: [],
+ results: search.results,
};
};
@@ -139,7 +139,7 @@ cr.define('bookmarks', function() {
return {
term: '',
inProgress: false,
- results: [],
+ results: null,
};
};
@@ -149,6 +149,9 @@ cr.define('bookmarks', function() {
* @return {SearchState}
*/
SearchState.removeDeletedResults = function(search, deletedIds) {
+ if (!search.results)
+ return search;
+
var newResults = [];
search.results.forEach(function(id) {
if (!deletedIds.has(id))
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/types.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698