Commit 7f3e8531 authored by Azeem Arshad's avatar Azeem Arshad Committed by Commit Bot

[CrOS Settings] Fix mobile-data subpage arrow button.

This CL fixes mobile-data network summary row not showing
arrow button when tethering is enabled but has no active
tether connections. Clicking the row in this case, however,
does indeed navigate to the subpage to allow user to scan
and show tethering information. Fixed this with a more
correct check for arrow button visibility.

Fixed: 1141238
Change-Id: I7eec6495562942ed068e5c826c2ba258fe027962
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2491103Reviewed-by: default avatarJon Mann <jonmann@chromium.org>
Commit-Queue: Azeem Arshad <azeemarshad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#819873}
parent a7d9982a
......@@ -70,8 +70,8 @@
</cr-policy-indicator>
</template>
<template is="dom-if" if="[[showDetailsIsVisible_(activeNetworkState,
deviceState, networkStateList)]]">
<template is="dom-if" if="[[showArrowButton_(activeNetworkState,
deviceState, networkStateList)]]">
<cr-icon-button class="subpage-arrow"
aria-labelledby="networkTitleText"
aria-describedby="networkState networkIcon"
......
......@@ -355,7 +355,7 @@ Polymer({
* @return {boolean}
* @private
*/
showDetailsIsVisible_(activeNetworkState, deviceState, networkStateList) {
shouldShowDetails_(activeNetworkState, deviceState, networkStateList) {
if (!!deviceState && deviceState.type == mojom.NetworkType.kVPN) {
return this.anyVpnExists_(deviceState, networkStateList);
}
......@@ -415,7 +415,7 @@ Polymer({
} else if (this.shouldShowSubpage_(
this.deviceState, this.networkStateList)) {
this.fire('show-networks', this.deviceState.type);
} else if (this.showDetailsIsVisible_(
} else if (this.shouldShowDetails_(
this.activeNetworkState, this.deviceState,
this.networkStateList)) {
if (this.activeNetworkState.guid) {
......@@ -447,7 +447,23 @@ Polymer({
// Item is actionable if tapping should show either networks subpage or the
// network details page.
return this.shouldShowSubpage_(this.deviceState, this.networkStateList) ||
this.showDetailsIsVisible_(
this.shouldShowDetails_(
activeNetworkState, deviceState, networkStateList);
},
/**
* @param {!OncMojo.NetworkStateProperties} activeNetworkState
* @param {!OncMojo.DeviceStateProperties|undefined} deviceState
* @param {!Array<!OncMojo.NetworkStateProperties>} networkStateList
* @return {boolean}
* @private
*/
showArrowButton_(activeNetworkState, deviceState, networkStateList) {
if (!this.deviceIsEnabled_(deviceState)) {
return false;
}
return this.shouldShowSubpage_(deviceState, networkStateList) ||
this.shouldShowDetails_(
activeNetworkState, deviceState, networkStateList);
},
......
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