File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments