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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
1.5 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 { first } from "rxjs/operators";
2022-06-14 17:10:53 +02:00
import { CollectionsComponent as BaseCollectionsComponent } from "@bitwarden/angular/components/collections.component";
import { CipherService } from "@bitwarden/common/abstractions/cipher.service";
import { CollectionService } from "@bitwarden/common/abstractions/collection.service";
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
import { LogService } from "@bitwarden/common/abstractions/log.service";
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
2018-10-23 18:16:27 +02:00
@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,
logService: LogService
) {
super(collectionService, platformUtilsService, i18nService, cipherService, logService);
2018-10-23 18:16:27 +02:00
}
async ngOnInit() {
2018-10-23 21:56:45 +02:00
this.onSavedCollections.subscribe(() => {
this.back();
});
this.route.queryParams.pipe(first()).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();
2018-10-23 18:16:27 +02:00
});
}
back() {
this.location.back();
}
}