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

Unified Diff: chrome/browser/resources/md_history/list_container.js

Issue 2122823002: [MD History] Fix issues caused by refactor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@funky_fresh
Patch Set: fix nit Created 4 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
Index: chrome/browser/resources/md_history/list_container.js
diff --git a/chrome/browser/resources/md_history/list_container.js b/chrome/browser/resources/md_history/list_container.js
index 11f2674d3afce73c5cfd5d8acb666a8b07b59987..76cb2f5e1c83e3d5793157e4072a9bf2ce4ad373 100644
--- a/chrome/browser/resources/md_history/list_container.js
+++ b/chrome/browser/resources/md_history/list_container.js
@@ -2,12 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-/**
- * @typedef {{results: ?Array<!HistoryEntry>,
- * info: ?HistoryQuery}}
- */
-var QueryResult;
-
Polymer({
is: 'history-list-container',
@@ -19,21 +13,10 @@ Polymer({
grouped: Boolean,
/** @type {!QueryState} */
- queryState: {
- type: Object,
- },
+ queryState: Object,
/** @type {!QueryResult} */
- queryResult_: {
- type: Object,
- readOnly: true,
- value: function() {
- return {
- info: null,
- results: null,
- };
- }
- },
+ queryResult: Object,
},
observers: [
@@ -53,9 +36,6 @@ Polymer({
historyResult: function(info, results) {
this.initializeResults_(info, results);
- this.set('queryResult_.info', info);
- this.set('queryResult_.results', results);
-
if (this.selectedPage_ == 'grouped-list') {
this.$$('#grouped-list').historyData = results;
return;
@@ -75,8 +55,10 @@ Polymer({
queryHistory: function(incremental) {
var queryState = this.queryState;
// Disable querying until the first set of results have been returned.
- if (this.queryResult_.results == null || queryState.queryingDisabled)
+ if (!this.queryResult || this.queryResult.results == null ||
+ queryState.queryingDisabled) {
return;
+ }
this.set('queryState.querying', true);
this.set('queryState.incremental', incremental);
@@ -84,7 +66,7 @@ Polymer({
var lastVisitTime = 0;
if (incremental) {
- var lastVisit = this.queryResult_.results.slice(-1)[0];
+ var lastVisit = this.queryResult.results.slice(-1)[0];
lastVisitTime = lastVisit ? lastVisit.time : 0;
}

Powered by Google App Engine
This is Rietveld 408576698