Skip to content

Commit 2b2ec38

Browse files
Connor ClarkDevtools-frontend LUCI CQ
authored andcommitted
[RPP Observations] Fix wrong label for auto device option
Fixed: 393910806 Change-Id: Icd592debbad7707f58c23c1219718738159ffcac Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6237335 Commit-Queue: Connor Clark <[email protected]> Auto-Submit: Connor Clark <[email protected]> Reviewed-by: Adam Raine <[email protected]> Commit-Queue: Adam Raine <[email protected]>
1 parent 5c8f61b commit 2b2ec38

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

front_end/models/crux-manager/CrUXManager.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,12 @@ export class CrUXManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
384384
return 'ALL';
385385
}
386386

387+
resolveDeviceOptionToScope(option: DeviceOption): DeviceScope {
388+
return option === 'AUTO' ? this.#getAutoDeviceScope() : option;
389+
}
390+
387391
getSelectedDeviceScope(): DeviceScope {
388-
return this.fieldDeviceOption === 'AUTO' ? this.#getAutoDeviceScope() : this.fieldDeviceOption;
392+
return this.resolveDeviceOptionToScope(this.fieldDeviceOption);
389393
}
390394

391395
getSelectedScope(): Scope {

front_end/panels/timeline/components/LiveMetricsView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ export class LiveMetricsView extends LegacyWrapper.LegacyWrapper.WrappableCompon
711711
#getLabelForDeviceOption(deviceOption: DeviceOption): string {
712712
let baseLabel;
713713
if (deviceOption === 'AUTO') {
714-
const deviceScope = this.#cruxManager.getSelectedDeviceScope();
714+
const deviceScope = this.#cruxManager.resolveDeviceOptionToScope(deviceOption);
715715
const deviceScopeLabel = this.#getDeviceScopeDisplayName(deviceScope);
716716
baseLabel = i18nString(UIStrings.auto, {PH1: deviceScopeLabel});
717717
} else {

0 commit comments

Comments
 (0)