Skip to content

Commit cddb412

Browse files
Timeline viewer link: Check upload flag is true before adding link
1 parent 757b5c3 commit cddb412

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

lib/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class PWMetrics {
8383
this.displayOutput(results.median);
8484
} else if (this.flags.submit) {
8585
const sheets = new Sheets(this.sheets, this.clientSecret);
86-
await sheets.appendResults(results.runs);
86+
await sheets.appendResults(results.runs, this.flags.upload);
8787
}
8888
}
8989
return results;

lib/sheets/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,21 @@ class Sheets {
3939
}
4040
}
4141

42-
appendResults(results: Array<MetricsResults>) {
42+
appendResults(results: Array<MetricsResults>, upload: boolean) {
4343
switch (this.config.type) {
4444
case SHEET_TYPES.GOOGLE_SHEETS:
45-
return this.appendResultsToGSheets(results);
45+
return this.appendResultsToGSheets(results, upload);
4646
}
4747
}
4848

49-
async appendResultsToGSheets(results: Array<MetricsResults>) {
49+
async appendResultsToGSheets(results: Array<MetricsResults>, upload: boolean) {
5050
let valuesToAppend: Array<GSheetsValuesToAppend> = [];
5151
results.forEach(data => {
5252
const getTiming = (key: string) => data.timings.find(t => t.id === key).timing;
5353
const dateObj = new Date(data.generatedTime);
5454
let viewerUrl = '';
5555

56-
if(typeof data.fileId !== 'undefined') {
56+
if(upload && typeof data.fileId !== 'undefined') {
5757
viewerUrl = VIEWER_URL_PREFIX + data.fileId;
5858
}
5959

0 commit comments

Comments
 (0)