message: rep function refactor
diff: @@ -40,16 +40,9 @@ export class ChangeRepWidgetComponent implements OnInit {
  });
  // Detect if a wallet is reset
  - this.walletService.wallet.newWallet$.subscribe(async bool => {
  - if (bool) {
  - console.log('Reloading representatives..');
  - this.selectedAccount = null;
  - this.representatives = [];
  - this.changeableRepresentatives = [];
  - this.showRepChangeRequired = false;
  - this.updateDisplayedRepresentatives();
  - this.representatives = await this.repService.getRepresentativesOverview(); // calls walletReps$.next
  - console.log('Representatives reloaded');
  + this.walletService.wallet.newWallet$.subscribe(shouldReload => {
  + if (shouldReload) {
  + this.resetRepresentatives();
  }
  });
  @@ -65,6 +58,17 @@ export class ChangeRepWidgetComponent implements OnInit {
  });
  }
  + async resetRepresentatives() {
  + console.log('Reloading representatives..');
  + this.selectedAccount = null;
  + this.representatives = [];
  + this.changeableRepresentatives = [];
  + this.showRepChangeRequired = false;
  + this.updateDisplayedRepresentatives();
  + this.representatives = await this.repService.getRepresentativesOverview(); // calls walletReps$.next
  + console.log('Representatives reloaded');
  + }
  +
  async updateChangeableRepresentatives() {
  await this.repService.detectChangeableReps(this.representatives);
  }
  