From bcb73f6785356ced9dc8de952524ded4fe14b54b Mon Sep 17 00:00:00 2001 From: Filip Leitner Date: Fri, 16 Feb 2024 10:18:53 +0100 Subject: [PATCH] fix: Do not reset layerLoadingProgress.pending to 0 Load end might come sooner than some buffered loadstarts resulting in uneven numbers --- .../hslayers/shared/layer-manager/layer-manager.service.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/projects/hslayers/shared/layer-manager/layer-manager.service.ts b/projects/hslayers/shared/layer-manager/layer-manager.service.ts index 5458139867..15bce7e675 100644 --- a/projects/hslayers/shared/layer-manager/layer-manager.service.ts +++ b/projects/hslayers/shared/layer-manager/layer-manager.service.ts @@ -648,6 +648,7 @@ export class HsLayerManagerService { olLayer: Layer, ) => any, ) { + loadProgress.loadError += 1; this.changeLoadCounter(olLayer, loadProgress, -1); if (typeCallback) { typeCallback.bind(this)(loadProgress, olLayer); @@ -687,8 +688,6 @@ export class HsLayerManagerService { loadProgress: HsLayerLoadProgress, olLayer: Layer, ) { - this.changeLoadCounter(olLayer, loadProgress, -1); - loadProgress.loadError += 1; if (loadProgress.loadError == loadProgress.total) { loadProgress.error = true; } @@ -832,7 +831,6 @@ export class HsLayerManagerService { change: number, ): void { progress.pending += change; - progress.pending = progress.pending < 0 ? 0 : progress.pending; progress.loaded = progress.pending === 0; let percents = 0; if (progress.total > 0) {