diff --git a/apps/browser/src/_locales/en/messages.json b/apps/browser/src/_locales/en/messages.json index 231637d7af..f9bf1bc523 100644 --- a/apps/browser/src/_locales/en/messages.json +++ b/apps/browser/src/_locales/en/messages.json @@ -392,6 +392,12 @@ "unfavorite": { "message": "Unfavorite" }, + "itemAddedToFavorites": { + "message": "Item added to favorites" + }, + "itemRemovedFromFavorites": { + "message": "Item removed from favorites" + }, "notes": { "message": "Notes" }, diff --git a/apps/browser/src/vault/popup/components/vault-v2/item-more-options/item-more-options.component.ts b/apps/browser/src/vault/popup/components/vault-v2/item-more-options/item-more-options.component.ts index 9834dc553e..ac3acdcc8f 100644 --- a/apps/browser/src/vault/popup/components/vault-v2/item-more-options/item-more-options.component.ts +++ b/apps/browser/src/vault/popup/components/vault-v2/item-more-options/item-more-options.component.ts @@ -3,10 +3,17 @@ import { booleanAttribute, Component, Input } from "@angular/core"; import { Router, RouterModule } from "@angular/router"; import { JslibModule } from "@bitwarden/angular/jslib.module"; +import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; import { CipherRepromptType, CipherType } from "@bitwarden/common/vault/enums"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { DialogService, IconButtonModule, ItemModule, MenuModule } from "@bitwarden/components"; +import { + DialogService, + IconButtonModule, + ItemModule, + MenuModule, + ToastService, +} from "@bitwarden/components"; import { PasswordRepromptService } from "@bitwarden/vault"; import { BrowserApi } from "../../../../../platform/browser/browser-api"; @@ -38,8 +45,10 @@ export class ItemMoreOptionsComponent { private cipherService: CipherService, private vaultPopupItemsService: VaultPopupItemsService, private passwordRepromptService: PasswordRepromptService, + private toastService: ToastService, private dialogService: DialogService, private router: Router, + private i18nService: I18nService, ) {} get canEdit() { @@ -85,6 +94,13 @@ export class ItemMoreOptionsComponent { this.cipher.favorite = !this.cipher.favorite; const encryptedCipher = await this.cipherService.encrypt(this.cipher); await this.cipherService.updateWithServer(encryptedCipher); + this.toastService.showToast({ + variant: "success", + title: null, + message: this.i18nService.t( + this.cipher.favorite ? "itemAddedToFavorites" : "itemRemovedFromFavorites", + ), + }); } /**