Skip to content

Commit

Permalink
Fix #993: Tie channel selection to probe.info.history options
Browse files Browse the repository at this point in the history
Note: This also removes `prerelease` which isn't a key we get from
probe-search.
  • Loading branch information
robhudson committed Oct 26, 2020
1 parent 53c954b commit 716fd54
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/config/firefox-desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default {
],
defaultValue: 'nightly',
isValidKey(key, probe) {
return (probe.prerelease && key !== 'release') || !probe.prerelease;
return key in probe.info.history;
},
},
os: {
Expand Down Expand Up @@ -178,9 +178,14 @@ export default {
const newProcess = probe.info.calculated.seen_in_processes[0];
store.setDimension('process', newProcess);
}
// If channel isn't included in history, reset state to channel that is
if (!(state.productDimensions.channel in probe.info.history)) {
store.setDimension('channel', Object.keys(probe.info.history)[0]);
}
// accommodate prerelease-only probes by resetting to nightly (if needed)
if (
state.productDimensions.channel === 'release' &&
'release' in probe.info.history &&
!probe.info.history.release[0].optout
) {
store.setDimension('channel', 'nightly');
Expand Down

0 comments on commit 716fd54

Please sign in to comment.