Skip to content

Commit 9324128

Browse files
committed
feat(loading): delete restore properties unnecessary
1 parent 41d73b4 commit 9324128

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/providers/loading-ionic.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ export class LoadingIonicPlugin extends PluginBase implements PreRequestPlugin,
1515

1616
protected loadingOptions: Object = {};
1717

18-
protected originalLoadingOptions: Object;
19-
2018
protected presentLoading: boolean = false;
2119

2220
constructor(private loadingController: LoadingController) {
@@ -32,8 +30,6 @@ export class LoadingIonicPlugin extends PluginBase implements PreRequestPlugin,
3230
}
3331

3432
preRequest() {
35-
this.originalLoadingOptions = Object.assign({}, this.loadingOptions);
36-
3733
if (this.skippedCount) {
3834
if (this.allow && !this.presentLoading) {
3935
this.presentLoading = true;
@@ -60,24 +56,23 @@ export class LoadingIonicPlugin extends PluginBase implements PreRequestPlugin,
6056
this.loading.dismissAll();
6157
}
6258

63-
// reset values
6459
this.loading = null;
65-
this.loadingOptions = this.originalLoadingOptions;
66-
this.allow = true;
67-
68-
this.restoreOptions();
6960
}
7061

7162
postRequest() {
7263
if (this.loading !== null && this.skippedCount === null) {
7364
this.dismiss();
7465
}
66+
67+
this.restoreOptions();
7568
}
7669

7770
postRequestError() {
7871
if (this.loading !== null) {
7972
this.dismiss();
8073
}
74+
75+
this.restoreOptions();
8176
}
8277

8378
disableLoading(skip?: boolean | number): this {

0 commit comments

Comments
 (0)