<commit_before>import { Injectable } from '@angular/core';
import { Observable, of, merge } from 'rxjs';
import { mergeMap, catchError } from 'rxjs/operators';

import { AccountsService } from './accounts.service';
import { UserService } from './user.service';

@Injectable()
export class UpdateService {
  update(): Observable<any> {
    return merge(
      this.accountsService.update().pipe(catchError((err) => of(err))),
      this.userService.update().pipe(catchError((err) => of(err)))
    );  
    //No need to update transactions, since they automatically update if accounts change
    //No need to update tags, since they automatically update if user data changes
  }
  constructor(
    private accountsService: AccountsService,
    private userService: UserService
  ){
    this.update().subscribe();
    this.userService.importObservable.pipe(mergeMap(() => this.update())).subscribe();
  }
}<commit_msg>Bigfix: when a non-transactions page (such as accounts) is loaded, switching to the transactions page results in an empty transactions table.<commit_after>import { Injectable } from '@angular/core';
import { Observable, of, merge } from 'rxjs';
import { mergeMap, catchError } from 'rxjs/operators';

import { AccountsService } from './accounts.service';
import { TransactionsService } from './transactions.service';
import { UserService } from './user.service';

@Injectable()
export class UpdateService {
  update(): Observable<any> {
    return merge(
      this.accountsService.update().pipe(catchError((err) => of(err))),
      this.transactionsService.update().pipe(catchError((err) => of(err))),
      this.userService.update().pipe(catchError((err) => of(err)))
    );  
    //No need to update transactions, since they automatically update if accounts change
    //No need to update tags, since they automatically update if user data changes
  }
  constructor(
    private accountsService: AccountsService,
    private transactionsService: TransactionsService,
    private userService: UserService
  ){
    this.update().subscribe();
    this.userService.importObservable.pipe(mergeMap(() => this.update())).subscribe();
  }
}
{'fraction_non_alphanumeric': 0.13023255813953488, 'fraction_numerical': 0.0, 'mean_word_length': 4.445569620253164, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2956231', 'n_tokens_mistral': 576, 'n_tokens_neox': 576, 'n_words': 169}