import { Location } from "@angular/common" ; import { Component } from "@angular/core" ; import { ActivatedRoute } from "@angular/router" ; import { first } from "rxjs/operators" ; import { CipherService } from "jslib-common/abstractions/cipher.service" ; import { CollectionService } from "jslib-common/abstractions/collection.service" ; import { I18nService } from "jslib-common/abstractions/i18n.service" ; import { LogService } from "jslib-common/abstractions/log.service" ; import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service" ; import { CollectionsComponent as BaseCollectionsComponent } from "jslib-angular/components/collections.component" ; @ Component ( { selector : "app-vault-collections" , templateUrl : "collections.component.html" , } ) export class CollectionsComponent extends BaseCollectionsComponent { constructor ( collectionService , platformUtilsService , i18nService , cipherService , private route , private location , logService ) { super ( collectionService , platformUtilsService , i18nService , cipherService , logService ) ; } async ngOnInit ( ) { this . onSavedCollections . subscribe ( ( ) => { this . back ( ) ; } ) ; this . route . queryParams . pipe ( first ( ) ) . subscribe ( async ( params ) => { this . cipherId = params . cipherId ; await this . load ( ) ; } ) ; } back ( ) { this . location . back ( ) ; } }