mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 21:33:27 +00:00
PM-20546 pass folder to openAddEditVaultItemPopout (#14524)
This commit is contained in:
@@ -801,7 +801,7 @@ export default class NotificationBackground {
|
||||
message: NotificationBackgroundExtensionMessage,
|
||||
senderTab: chrome.tabs.Tab,
|
||||
) {
|
||||
const { cipherId, organizationId } = message;
|
||||
const { cipherId, organizationId, folder } = message;
|
||||
const userId = await firstValueFrom(this.accountService.activeAccount$.pipe(getOptionalUserId));
|
||||
if (cipherId) {
|
||||
await this.openAddEditVaultItemPopout(senderTab, { cipherId });
|
||||
@@ -813,6 +813,7 @@ export default class NotificationBackground {
|
||||
if (queueItem?.type === NotificationQueueMessageType.AddLogin) {
|
||||
const cipherView = this.convertAddLoginQueueMessageToCipherView(queueItem);
|
||||
cipherView.organizationId = organizationId;
|
||||
cipherView.folderId = folder;
|
||||
|
||||
if (userId) {
|
||||
await this.cipherService.setAddEditCipherInfo({ cipher: cipherView }, userId);
|
||||
|
||||
@@ -263,16 +263,16 @@ function handleCloseNotification(e: Event) {
|
||||
|
||||
function handleSaveAction(e: Event) {
|
||||
const selectedVault = selectedVaultSignal.get();
|
||||
const selectedFolder = selectedFolderSignal.get();
|
||||
|
||||
if (selectedVault.length > 1) {
|
||||
openAddEditVaultItemPopout(e, { organizationId: selectedVault });
|
||||
openAddEditVaultItemPopout(e, { organizationId: selectedVault, folder: selectedFolder });
|
||||
handleCloseNotification(e);
|
||||
return;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
const selectedFolder = selectedFolderSignal.get();
|
||||
|
||||
sendSaveCipherMessage(removeIndividualVault(), selectedFolder);
|
||||
if (removeIndividualVault()) {
|
||||
return;
|
||||
@@ -370,7 +370,7 @@ function handleSaveCipherAttemptCompletedMessage(message: NotificationBarWindowM
|
||||
|
||||
function openAddEditVaultItemPopout(
|
||||
e: Event,
|
||||
options: { cipherId?: string; organizationId?: string },
|
||||
options: { cipherId?: string; organizationId?: string; folder?: string },
|
||||
) {
|
||||
e.preventDefault();
|
||||
sendPlatformMessage({
|
||||
|
||||
Reference in New Issue
Block a user