Mike0021 commited on
Commit
d75f001
·
verified ·
1 Parent(s): 837ca85

Make benchmark download cache-safe

Browse files
Files changed (1) hide show
  1. app.js +2 -2
app.js CHANGED
@@ -1525,7 +1525,7 @@ function parseMetricMs(text) {
1525
  function renderBenchmarkResults() {
1526
  elements.resultsBody.replaceChildren();
1527
  elements.copyResultsButton.disabled = state.benchmarkResults.length === 0;
1528
- elements.downloadResultsButton.disabled = state.benchmarkResults.length === 0;
1529
  elements.clearResultsButton.disabled = state.benchmarkResults.length === 0;
1530
  renderBenchmarkSummary();
1531
  if (state.benchmarkResults.length === 0) {
@@ -2562,7 +2562,7 @@ elements.copyResultsButton.addEventListener("click", () => {
2562
  logEvent(payload);
2563
  }
2564
  });
2565
- elements.downloadResultsButton.addEventListener("click", downloadBenchmarkJson);
2566
  elements.clearResultsButton.addEventListener("click", () => {
2567
  cancelMicSeries();
2568
  clearBenchmarkTimeout();
 
1525
  function renderBenchmarkResults() {
1526
  elements.resultsBody.replaceChildren();
1527
  elements.copyResultsButton.disabled = state.benchmarkResults.length === 0;
1528
+ if (elements.downloadResultsButton) elements.downloadResultsButton.disabled = state.benchmarkResults.length === 0;
1529
  elements.clearResultsButton.disabled = state.benchmarkResults.length === 0;
1530
  renderBenchmarkSummary();
1531
  if (state.benchmarkResults.length === 0) {
 
2562
  logEvent(payload);
2563
  }
2564
  });
2565
+ elements.downloadResultsButton?.addEventListener("click", downloadBenchmarkJson);
2566
  elements.clearResultsButton.addEventListener("click", () => {
2567
  cancelMicSeries();
2568
  clearBenchmarkTimeout();