Skip to content

Commit 0a92eee

Browse files
committed
chore: Explain reasoning, address comment
1 parent a42a93a commit 0a92eee

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Uno.Wasm.Bootstrap/ts/Uno/WebAssembly/Bootstrapper.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,16 @@ namespace Uno.WebAssembly.Bootstrap {
284284

285285
// The totalResources value reported by .NET does not represent
286286
// the actual total. To prevent progress bar from jumping
287-
// setting the max progress to 100 instead.
287+
// setting the max progress to 100 instead and initially target 50
288+
// When total number of resources increases, we always increase the target by half of the remainder to 100
289+
// Usually the total grows several times, so ultimately the progress will appear as converging to completion.
288290
if (_previousTotalResources != totalResources)
289291
{
290292
this._currentTargetProgress = this._currentTargetProgress + (100 - this._currentTargetProgress) / 2;
291293
this._previousTotalResources = totalResources;
292294
}
293295

294-
(<any>this.progress).value = Math.min(resourcesLoaded, this._currentTargetProgress);
296+
this.progress.value = Math.min(resourcesLoaded, this._currentTargetProgress);
295297
}
296298

297299
private initProgress() {

0 commit comments

Comments
 (0)