Skip to content

Commit 5a449b4

Browse files
committed
docs: reword comment for clarity
1 parent 460aa53 commit 5a449b4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

site/src/pages/WorkspacePage/WorkspaceActions/DownloadLogsDialog.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const DownloadLogsDialog: FC<DownloadLogsDialogProps> = ({
6363
// memoization for now, but if we get to a point where performance matters,
6464
// we should make it so that this state doesn't even begin to mount until the
6565
// user decides to open the Logs dropdown
66-
const allFiles = ((): readonly DownloadableFile[] => {
66+
const allFiles: readonly DownloadableFile[] = (() => {
6767
const files = allUniqueAgents.map<DownloadableFile>((a, i) => {
6868
const name = `${a.name}-logs.txt`;
6969
const txt = agentLogQueries[i]?.data?.map((l) => l.output).join("\n");
@@ -76,7 +76,7 @@ export const DownloadLogsDialog: FC<DownloadLogsDialogProps> = ({
7676
return { name, blob };
7777
});
7878

79-
const buildLogFile = {
79+
const buildLogsFile = {
8080
name: `${workspace.name}-build-logs.txt`,
8181
blob: buildLogsQuery.data
8282
? new Blob([buildLogsQuery.data.map((l) => l.output).join("\n")], {
@@ -85,7 +85,7 @@ export const DownloadLogsDialog: FC<DownloadLogsDialogProps> = ({
8585
: undefined,
8686
};
8787

88-
files.unshift(buildLogFile);
88+
files.unshift(buildLogsFile);
8989
return files;
9090
})();
9191

@@ -232,8 +232,9 @@ function humanBlobSize(size: number) {
232232
}
233233

234234
// 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
237238
const finalUnit = BLOB_SIZE_UNITS[i] ?? BLOB_SIZE_UNITS.at(-1) ?? "TB";
238239
return `${size.toFixed(2)} ${finalUnit}`;
239240
}

0 commit comments

Comments
 (0)