Skip to content

Commit 62ba9ee

Browse files
committed
not null for crc fail
1 parent eb645b3 commit 62ba9ee

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/js/tabs/onboard_logging.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,10 +497,10 @@ function onChunkRead(chunkAddress, chunkDataView, bytesCompressed) {
497497

498498
nextAddress += chunkDataView.byteLength;
499499

500-
if (!isNaN(bytesCompressed) && !isNaN(totalBytesCompressed)) {
500+
// Track total compressed bytes, if provided
501+
if (typeof bytesCompressed === "number") {
502+
if (totalBytesCompressed == null) totalBytesCompressed = 0; // initialize if previously unknown
501503
totalBytesCompressed += bytesCompressed;
502-
} else {
503-
totalBytesCompressed = null;
504504
}
505505

506506
$(".dataflash-saving progress").attr("value", (nextAddress / maxBytes) * 100);
@@ -531,7 +531,8 @@ function onChunkRead(chunkAddress, chunkDataView, bytesCompressed) {
531531
}
532532
}
533533

534-
const startTime = new Date().getTime();
534+
const startTime = new Date().getTime(); // Start timestamp
535+
535536
// Fetch the initial block
536537
FileSystem.openFile(fileWriter).then((file) => {
537538
openedFile = file;

0 commit comments

Comments
 (0)