import { BrowserApi } from "../../browser/browserApi" ; import { Injectable } from "@angular/core" ; import { CanActivate , Router } from "@angular/router" ; import { UnauthGuardService } from "jslib-angular/services/unauth-guard.service" ; @ Injectable ( ) export class LaunchGuardService implements CanActivate { constructor ( private router , private unauthGuardService ) { } async canActivate ( ) { if ( BrowserApi . getBackgroundPage ( ) == null ) { this . router . navigate ( [ "private-mode" ] ) ; return false ; } return await this . unauthGuardService . canActivate ( ) ; } }