1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 05:43:41 +00:00

[PM-254] Set PDF Attachments in Web to download, add success toast (#10757)

* add success toast to pdf attachment download in web

* update desktop attachments for toastService

* removed trailing comma

---------

Co-authored-by: gbubemismith <gsmithwalter@gmail.com>
Co-authored-by: SmithThe4th <gsmith@bitwarden.com>
This commit is contained in:
Jason Ng
2024-09-11 15:27:53 -04:00
committed by GitHub
parent 2cfbfcbdfe
commit 89751f46d6
10 changed files with 33 additions and 10 deletions

View File

@@ -17,7 +17,7 @@ import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.servi
import { Cipher } from "@bitwarden/common/vault/models/domain/cipher";
import { AttachmentView } from "@bitwarden/common/vault/models/view/attachment.view";
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { DialogService } from "@bitwarden/components";
import { DialogService, ToastService } from "@bitwarden/components";
@Directive()
export class AttachmentsComponent implements OnInit {
@@ -49,6 +49,7 @@ export class AttachmentsComponent implements OnInit {
protected dialogService: DialogService,
protected billingAccountProfileStateService: BillingAccountProfileStateService,
protected accountService: AccountService,
protected toastService: ToastService,
) {}
async ngOnInit() {
@@ -182,6 +183,11 @@ export class AttachmentsComponent implements OnInit {
fileName: attachment.fileName,
blobData: decBuf,
});
this.toastService.showToast({
variant: "success",
title: null,
message: this.i18nService.t("fileSavedToDevice"),
});
} catch (e) {
this.platformUtilsService.showToast("error", null, this.i18nService.t("errorOccurred"));
}