File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
src/Uno.Wasm.Bootstrap/ts/Uno/WebAssembly Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ namespace Uno.WebAssembly.Bootstrap {
34
34
private _isUsingCommonJS : boolean ;
35
35
private _currentBrowserIsChrome : boolean ;
36
36
private _hasReferencedPdbs : boolean ;
37
+ private _previousTotalResources : number ;
38
+ private _currentTargetProgress : number ;
37
39
38
40
static ENVIRONMENT_IS_WEB : boolean ;
39
41
static ENVIRONMENT_IS_WORKER : boolean ;
@@ -278,11 +280,18 @@ namespace Uno.WebAssembly.Bootstrap {
278
280
}
279
281
280
282
private reportDownloadResourceProgress ( resourcesLoaded : number , totalResources : number ) {
283
+ this . progress . max = 100 ;
284
+
281
285
// The totalResources value reported by .NET does not represent
282
286
// the actual total. To prevent progress bar from jumping
283
287
// setting the max progress to 100 instead.
284
- this . progress . max = 100 ;
285
- ( < any > this . progress ) . value = Math . min ( resourcesLoaded , 100 ) ;
288
+ if ( _previousTotalResources != totalResources )
289
+ {
290
+ _currentTargetProgress = ( 100 - _currentTargetProgress ) / 2 ;
291
+ _previousTotalResources = totalResources ;
292
+ }
293
+
294
+ ( < any > this . progress ) . value = Math . min ( resourcesLoaded , _currentTargetProgress ) ;
286
295
}
287
296
288
297
private initProgress ( ) {
You can’t perform that action at this time.
0 commit comments