diff --git a/apps/browser/src/autofill/background/notification.background.ts b/apps/browser/src/autofill/background/notification.background.ts index 4e2a99d4a7a..339b033809d 100644 --- a/apps/browser/src/autofill/background/notification.background.ts +++ b/apps/browser/src/autofill/background/notification.background.ts @@ -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); diff --git a/apps/browser/src/autofill/notification/bar.ts b/apps/browser/src/autofill/notification/bar.ts index 14d9bcd6d0f..d9a5c937f9c 100644 --- a/apps/browser/src/autofill/notification/bar.ts +++ b/apps/browser/src/autofill/notification/bar.ts @@ -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({