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

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

Issue 2752223004: MD Bookmarks: Remove deleted nodes from state tree (Closed)
Patch Set: Rebase Created 3 years, 8 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 | « chrome/browser/resources/md_bookmarks/reducers.js ('k') | chrome/browser/resources/md_bookmarks/util.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_bookmarks/store_client.js
diff --git a/chrome/browser/resources/md_bookmarks/store_client.js b/chrome/browser/resources/md_bookmarks/store_client.js
index 344df43db1ea8142842866d281d8346b0273021f..7d1512734967740a7b2c1f51f90ab171bc17bd8a 100644
--- a/chrome/browser/resources/md_bookmarks/store_client.js
+++ b/chrome/browser/resources/md_bookmarks/store_client.js
@@ -38,7 +38,8 @@ cr.define('bookmarks', function() {
* watch('item', (state) => state.nodes[this.itemId]);
*
* Note that object identity is used to determine if the value has changed
- * before updating the UI, rather than Polymer-style deep equality.
+ * before updating the UI, rather than Polymer-style deep equality. If the
+ * getter function returns |undefined|, no changes will propagate to the UI.
*
* Typechecking is supressed because this conflicts with
* Object.prototype.watch, which is a Gecko-only method that is recognized
@@ -73,7 +74,7 @@ cr.define('bookmarks', function() {
// Avoid poking Polymer unless something has actually changed. Reducers
// must return new objects rather than mutating existing objects, so
// any real changes will pass through correctly.
- if (oldValue == newValue)
+ if (oldValue == newValue || newValue == undefined)
return;
this[watch.localProperty] = newValue;
« no previous file with comments | « chrome/browser/resources/md_bookmarks/reducers.js ('k') | chrome/browser/resources/md_bookmarks/util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698