Commit dbab684c authored by rbpotter's avatar rbpotter Committed by Commit Bot

Print Preview: Remove unnecessary destination logic

This logic isn't needed any more, since cloud destinations get
fetched when login state changes, and we update the recent list when
destinations are inserted. It may also be contributing to some bugs
that so far are not reproducible.

Bug: 923914, 924889
Change-Id: Ibfef7f183a66da373d7d7f4775896d9ba39c22c3
Reviewed-on: https://chromium-review.googlesource.com/c/1436193Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626241}
parent d2f7dfae
......@@ -107,12 +107,6 @@ Polymer({
const recentDestinations = [];
let update = false;
let filterAccount = this.activeUser;
// Fallback to the account for the current destination, in case activeUser
// is not known yet from cloudprint.
if (!filterAccount) {
filterAccount = this.destination ? this.destination.account : '';
}
const existingKeys = this.recentDestinationList_ ?
this.recentDestinationList_.map(listItem => listItem.key) :
[];
......@@ -120,7 +114,7 @@ Polymer({
const key = print_preview.createRecentDestinationKey(recentDestination);
const destination = this.destinationStore.getDestinationByKey(key);
if (destination && !this.destinationIsDriveOrPdf_(recentDestination) &&
(!destination.account || destination.account == filterAccount)) {
(!destination.account || destination.account == this.activeUser)) {
recentDestinations.push(destination);
update = update || !existingKeys.includes(key);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment