bitwarden-estensione-browser/src/popup/vault/collections.component.ts

40 lines
1.4 KiB
TypeScript
Raw Normal View History

2018-10-23 18:16:27 +02:00
import { Location } from '@angular/common';
import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { CipherService } from 'jslib/abstractions/cipher.service';
import { CollectionService } from 'jslib/abstractions/collection.service';
import { I18nService } from 'jslib/abstractions/i18n.service';
import { PlatformUtilsService } from 'jslib/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: CollectionService, platformUtilsService: PlatformUtilsService,
i18nService: I18nService, cipherService: CipherService,
private route: ActivatedRoute, private location: Location) {
super(collectionService, platformUtilsService, i18nService, cipherService);
}
async ngOnInit() {
2018-10-23 21:56:45 +02:00
this.onSavedCollections.subscribe(() => {
this.back();
});
2018-12-20 16:20:57 +01:00
const queryParamsSub = this.route.queryParams.subscribe(async (params) => {
2018-10-23 18:16:27 +02:00
this.cipherId = params.cipherId;
2019-03-06 20:31:50 +01:00
await this.load();
2019-01-17 05:30:39 +01:00
if (queryParamsSub != null) {
queryParamsSub.unsubscribe();
}
2018-10-23 18:16:27 +02:00
});
}
back() {
this.location.back();
}
}