Skip to content

Commit

Permalink
use acronyms for shorter urls (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark authored Jun 12, 2020
1 parent fea39b8 commit 3c71b52
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions script/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class App extends Component {
debounce(_ => {
const url = new URL(location.href);
const auditIdValuePairs = Object.entries(metricValues).map(([id, value]) => {
return [metrics[id].auditId, value];
return [id, value];
});
const params = new URLSearchParams(auditIdValuePairs);
params.set('device', device);
Expand Down Expand Up @@ -287,10 +287,10 @@ function getInitialState() {
}

// Load from query string.
for (const [id, metric] of Object.entries(metricValues)) {
if (!params.has(metric.auditId)) continue;
const value = Number(params.get(metric.auditId));
metricValues[id] = value;
for (const [id, metric] of Object.entries(metrics)) {
const value = params.get(id) || params.get(metric.auditId);
if (value === undefined) continue;
metricValues[id] = Number(value);
}

return {
Expand Down

0 comments on commit 3c71b52

Please sign in to comment.