Commit 49687e0b authored by Sigurdur Asgeirsson's avatar Sigurdur Asgeirsson Committed by Commit Bot

Fix navigation for the discards tab in chrome://discards.

Special-casing the 'Discards' tab to the empty tab makes the initial
page load navigation entry consistent with entry on back navigation.

Bug: 1070554
Change-Id: Ib1d6f271e12d97db31cd03708f89b41a26009e64
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2148539
Commit-Queue: Sigurður Ásgeirsson <siggi@chromium.org>
Reviewed-by: default avatardpapad <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#758979}
parent 1a374122
...@@ -45,7 +45,10 @@ Polymer({ ...@@ -45,7 +45,10 @@ Polymer({
*/ */
selectedChanged_(newValue, oldValue) { selectedChanged_(newValue, oldValue) {
if (oldValue != undefined) { if (oldValue != undefined) {
this.path = '/' + this.tabs[newValue].toLowerCase(); // The first tab is special-cased to the empty path.
const defaultTab = this.tabs[0].toLowerCase();
const tabName = this.tabs[newValue].toLowerCase();
this.path = '/' + (tabName === defaultTab ? '' : tabName);
} }
}, },
......
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