Skip to content
This repository was archived by the owner on Dec 19, 2021. It is now read-only.

Commit 252d122

Browse files
committed
use for loop and clean up hide method
1 parent b50a787 commit 252d122

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/loading-indicator.android.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,16 @@ export class LoadingIndicator {
5959
}
6060

6161
hide() {
62-
let i = 0;
6362
try {
64-
this._loadersInstances.forEach(loader => {
63+
for (let i = 0; i < this._loadersInstances.length; i++) {
64+
const loader = this._loadersInstances[i];
6565
if (loader) {
6666
if (this._isShowing(loader)) {
6767
loader.dismiss();
68+
this._loadersInstances.splice(i, 1);
6869
}
6970
}
70-
this._loadersInstances.splice(i, 1);
71-
i++;
72-
});
71+
}
7372

7473
this._popOver = null;
7574
this._currentProgressColor = null;

0 commit comments

Comments
 (0)