Skip to content

Commit

Permalink
fix: Do not reset layerLoadingProgress.pending to 0
Browse files Browse the repository at this point in the history
Load end might come sooner than some buffered loadstarts resulting in uneven numbers
  • Loading branch information
FilipLeitner authored and jmacura committed Feb 23, 2024
1 parent bd40e30 commit bcb73f6
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ export class HsLayerManagerService {
olLayer: Layer<Source>,
) => any,
) {
loadProgress.loadError += 1;
this.changeLoadCounter(olLayer, loadProgress, -1);
if (typeCallback) {
typeCallback.bind(this)(loadProgress, olLayer);
Expand Down Expand Up @@ -687,8 +688,6 @@ export class HsLayerManagerService {
loadProgress: HsLayerLoadProgress,
olLayer: Layer<Source>,
) {
this.changeLoadCounter(olLayer, loadProgress, -1);
loadProgress.loadError += 1;
if (loadProgress.loadError == loadProgress.total) {
loadProgress.error = true;
}
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit bcb73f6

Please sign in to comment.