mirror of
https://github.com/esphome/esp-web-tools.git
synced 2025-07-28 06:06:36 +00:00
Fix write percentage progress
This commit is contained in:
parent
e13f595f5e
commit
2488ffb403
@ -145,11 +145,14 @@ export const startFlash = async (
|
|||||||
content: html`Writing progress: ${lastPct}%`,
|
content: html`Writing progress: ${lastPct}%`,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let totalWritten = 0;
|
||||||
|
|
||||||
for (const part of build.parts) {
|
for (const part of build.parts) {
|
||||||
await espStub.flashData(
|
await espStub.flashData(
|
||||||
files.shift()!,
|
files.shift()!,
|
||||||
(newBytesWritten) => {
|
(newBytesWritten) => {
|
||||||
const newPct = Math.floor((newBytesWritten / totalSize) * 100);
|
totalWritten += newBytesWritten;
|
||||||
|
const newPct = Math.floor((totalWritten / totalSize) * 100);
|
||||||
if (newPct === lastPct) {
|
if (newPct === lastPct) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user