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