@@ -63,7 +63,7 @@ export const DownloadLogsDialog: FC<DownloadLogsDialogProps> = ({
63
63
// memoization for now, but if we get to a point where performance matters,
64
64
// we should make it so that this state doesn't even begin to mount until the
65
65
// user decides to open the Logs dropdown
66
- const allFiles = ( ( ) : readonly DownloadableFile [ ] => {
66
+ const allFiles : readonly DownloadableFile [ ] = ( ( ) => {
67
67
const files = allUniqueAgents . map < DownloadableFile > ( ( a , i ) => {
68
68
const name = `${ a . name } -logs.txt` ;
69
69
const txt = agentLogQueries [ i ] ?. data ?. map ( ( l ) => l . output ) . join ( "\n" ) ;
@@ -76,7 +76,7 @@ export const DownloadLogsDialog: FC<DownloadLogsDialogProps> = ({
76
76
return { name, blob } ;
77
77
} ) ;
78
78
79
- const buildLogFile = {
79
+ const buildLogsFile = {
80
80
name : `${ workspace . name } -build-logs.txt` ,
81
81
blob : buildLogsQuery . data
82
82
? new Blob ( [ buildLogsQuery . data . map ( ( l ) => l . output ) . join ( "\n" ) ] , {
@@ -85,7 +85,7 @@ export const DownloadLogsDialog: FC<DownloadLogsDialogProps> = ({
85
85
: undefined ,
86
86
} ;
87
87
88
- files . unshift ( buildLogFile ) ;
88
+ files . unshift ( buildLogsFile ) ;
89
89
return files ;
90
90
} ) ( ) ;
91
91
@@ -232,8 +232,9 @@ function humanBlobSize(size: number) {
232
232
}
233
233
234
234
// The condition for the while loop above means that over time, we could break
235
- // out of the loop because we accidentally went out of the array bounds.
236
- // Adding a lot of redundant checks to make sure we always have a usable unit
235
+ // out of the loop because we accidentally shot past the array bounds and i
236
+ // is at index (BLOB_SIZE_UNITS.length). Adding a lot of redundant checks to
237
+ // make sure we always have a usable unit
237
238
const finalUnit = BLOB_SIZE_UNITS [ i ] ?? BLOB_SIZE_UNITS . at ( - 1 ) ?? "TB" ;
238
239
return `${ size . toFixed ( 2 ) } ${ finalUnit } ` ;
239
240
}
0 commit comments