Chromium Code Reviews| Index: chrome/browser/resources/md_bookmarks/router.js |
| diff --git a/chrome/browser/resources/md_bookmarks/router.js b/chrome/browser/resources/md_bookmarks/router.js |
| index 11d1d40104c5a4cc6d9409b5f11687d5b9715b6c..d215bb2b366028fc9b2875c6acf2ca0c494016cd 100644 |
| --- a/chrome/browser/resources/md_bookmarks/router.js |
| +++ b/chrome/browser/resources/md_bookmarks/router.js |
| @@ -42,6 +42,7 @@ Polymer({ |
| this.watch('searchTerm_', function(state) { |
| return state.search.term; |
| }); |
| + this.updateFromStore(); |
| }, |
| /** @private */ |
| @@ -58,7 +59,12 @@ Polymer({ |
| var selectedId = this.queryParams_.id; |
| if (selectedId && selectedId != this.selectedId_) { |
| this.selectedId_ = selectedId; |
| - this.dispatch(bookmarks.actions.selectFolder(selectedId)); |
| + // Need to dispatch a deferred action so that during page load |
| + // `this.getState()` will only evaluate after the Store is initialized. |
| + this.dispatch(function(dispatch) { |
| + dispatch( |
| + bookmarks.actions.selectFolder(selectedId, this.getState().nodes)); |
| + }.bind(this)); |
|
calamity
2017/05/02 08:27:15
So... If I understand correctly, the deferred acti
tsergeant
2017/05/03 02:57:31
Yup, that's the idea.
|
| } |
| }, |