mirror of
https://github.com/bitwarden/browser
synced 2025-12-21 02:33:46 +00:00
50 lines
1.7 KiB
TypeScript
50 lines
1.7 KiB
TypeScript
// FIXME: Update this file to be type safe and remove this and next line
|
|
// @ts-strict-ignore
|
|
import { CommonModule } from "@angular/common";
|
|
import { Component, Input } from "@angular/core";
|
|
import { firstValueFrom } from "rxjs";
|
|
|
|
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
|
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
|
import { getUserId } from "@bitwarden/common/auth/services/account.service";
|
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
|
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
|
import { LoginUriView } from "@bitwarden/common/vault/models/view/login-uri.view";
|
|
import {
|
|
CardComponent,
|
|
FormFieldModule,
|
|
IconButtonModule,
|
|
SectionHeaderComponent,
|
|
TypographyModule,
|
|
} from "@bitwarden/components";
|
|
|
|
@Component({
|
|
selector: "app-autofill-options-view",
|
|
templateUrl: "autofill-options-view.component.html",
|
|
imports: [
|
|
CommonModule,
|
|
JslibModule,
|
|
CardComponent,
|
|
SectionHeaderComponent,
|
|
TypographyModule,
|
|
FormFieldModule,
|
|
IconButtonModule,
|
|
],
|
|
})
|
|
export class AutofillOptionsViewComponent {
|
|
@Input() loginUris: LoginUriView[];
|
|
@Input() cipherId: string;
|
|
|
|
constructor(
|
|
private platformUtilsService: PlatformUtilsService,
|
|
private cipherService: CipherService,
|
|
private accountService: AccountService,
|
|
) {}
|
|
|
|
async openWebsite(selectedUri: string) {
|
|
const activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId));
|
|
await this.cipherService.updateLastLaunchedDate(this.cipherId, activeUserId);
|
|
this.platformUtilsService.launchUri(selectedUri);
|
|
}
|
|
}
|