Chore: refactor loading stuff to be more DRY

This commit is contained in:
shamoon
2024-12-09 12:36:48 -08:00
parent c2e34b36ce
commit 0a7c296194
34 changed files with 87 additions and 110 deletions

View File

@@ -48,9 +48,9 @@ export class MailComponent
}
public loadingRules: boolean = true
public revealRules: boolean = false
public showRules: boolean = false
public loadingAccounts: boolean = true
public revealAccounts: boolean = false
public showAccounts: boolean = false
constructor(
public mailAccountService: MailAccountService,
@@ -85,7 +85,7 @@ export class MailComponent
.subscribe({
next: () => {
this.loadingAccounts = false
this.revealAccounts = true
this.showAccounts = true
},
error: (e) => {
this.toastService.showError(
@@ -108,7 +108,7 @@ export class MailComponent
.subscribe({
next: (r) => {
this.loadingRules = false
this.revealRules = true
this.showRules = true
},
error: (e) => {
this.toastService.showError($localize`Error retrieving mail rules`, e)