author Ben Hayward
  import { Injectable } from '@angular/core' ; import { CanActivate , Router } from '@angular/router' ; import { WalletTabHistoryService } from '../tab-history.service' ; @ Injectable ( ) export class DefaultRedirectGuard implements CanActivate { constructor ( private router , private tabHistory ) { } returns canActivate ( ) { const lastTab = this . tabHistory . lastTab ; if ( lastTab ) { this . router . navigateByUrl ( `/wallet${ lastTab }` ) ; return false ; } this . router . navigateByUrl ( '/wallet/tokens/rewards' ) ; return true ; } }