mirror of
https://github.com/bitwarden/browser
synced 2026-02-18 18:33:50 +00:00
Merge branch 'main' into auth/pm-9115/implement-view-data-persistence-in-2FA-flows
This commit is contained in:
@@ -160,51 +160,42 @@ export default class NotificationBackground {
|
||||
|
||||
/**
|
||||
*
|
||||
* Gets the current active tab and retrieves all decrypted ciphers
|
||||
* for the tab's URL. It constructs and returns an array of `NotificationCipherData` objects.
|
||||
* Gets the current active tab and retrieves the relevant decrypted cipher
|
||||
* for the tab's URL. It constructs and returns an array of `NotificationCipherData` objects or a singular object.
|
||||
* If no active tab or URL is found, it returns an empty array.
|
||||
*
|
||||
* @returns {Promise<NotificationCipherData[]>}
|
||||
*/
|
||||
|
||||
async getNotificationCipherData(): Promise<NotificationCipherData[]> {
|
||||
const [currentTab, showFavicons, env] = await Promise.all([
|
||||
const [currentTab, showFavicons, env, activeUserId] = await Promise.all([
|
||||
BrowserApi.getTabFromCurrentWindow(),
|
||||
firstValueFrom(this.domainSettingsService.showFavicons$),
|
||||
firstValueFrom(this.environmentService.environment$),
|
||||
firstValueFrom(this.accountService.activeAccount$.pipe(getOptionalUserId)),
|
||||
]);
|
||||
|
||||
const [decryptedCiphers, organizations] = await Promise.all([
|
||||
this.cipherService.getAllDecryptedForUrl(currentTab?.url, activeUserId),
|
||||
firstValueFrom(this.organizationService.organizations$(activeUserId)),
|
||||
]);
|
||||
|
||||
const iconsServerUrl = env.getIconsUrl();
|
||||
const activeUserId = await firstValueFrom(
|
||||
this.accountService.activeAccount$.pipe(getOptionalUserId),
|
||||
);
|
||||
|
||||
const decryptedCiphers = await this.cipherService.getAllDecryptedForUrl(
|
||||
currentTab?.url,
|
||||
activeUserId,
|
||||
);
|
||||
|
||||
const organizations = await firstValueFrom(
|
||||
this.organizationService.organizations$(activeUserId),
|
||||
);
|
||||
|
||||
return decryptedCiphers.map((view) => {
|
||||
const toNotificationData = (view: CipherView): NotificationCipherData => {
|
||||
const { id, name, reprompt, favorite, login, organizationId } = view;
|
||||
|
||||
const organizationType = organizationId
|
||||
? organizations.find((org) => org.id === organizationId)?.productTierType
|
||||
: null;
|
||||
const type = organizations.find((org) => org.id === organizationId)?.productTierType;
|
||||
|
||||
const organizationCategories: OrganizationCategory[] = [];
|
||||
|
||||
if (
|
||||
[ProductTierType.Teams, ProductTierType.Enterprise, ProductTierType.TeamsStarter].includes(
|
||||
organizationType,
|
||||
type,
|
||||
)
|
||||
) {
|
||||
organizationCategories.push(OrganizationCategories.business);
|
||||
}
|
||||
if ([ProductTierType.Families, ProductTierType.Free].includes(organizationType)) {
|
||||
if ([ProductTierType.Families, ProductTierType.Free].includes(type)) {
|
||||
organizationCategories.push(OrganizationCategories.family);
|
||||
}
|
||||
|
||||
@@ -216,11 +207,21 @@ export default class NotificationBackground {
|
||||
favorite,
|
||||
...(organizationCategories.length ? { organizationCategories } : {}),
|
||||
icon: buildCipherIcon(iconsServerUrl, view, showFavicons),
|
||||
login: login && {
|
||||
username: login.username,
|
||||
},
|
||||
login: login && { username: login.username },
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
const changeItem = this.notificationQueue.find(
|
||||
(message): message is AddChangePasswordQueueMessage =>
|
||||
message.type === NotificationQueueMessageType.ChangePassword,
|
||||
);
|
||||
|
||||
if (changeItem) {
|
||||
const cipherView = await this.getDecryptedCipherById(changeItem.cipherId, activeUserId);
|
||||
return [toNotificationData(cipherView)];
|
||||
}
|
||||
|
||||
return decryptedCiphers.map(toNotificationData);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2015-2024 Bitwarden Inc. All rights reserved.</string>
|
||||
<string>Copyright © 2015-2025 Bitwarden Inc. All rights reserved.</string>
|
||||
<key>NSMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<string>$(PRODUCT_MODULE_NAME).SafariWebExtensionHandler</string>
|
||||
</dict>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2015-2024 Bitwarden Inc. All rights reserved.</string>
|
||||
<string>Copyright © 2015-2025 Bitwarden Inc. All rights reserved.</string>
|
||||
<key>NSHumanReadableDescription</key>
|
||||
<string>A secure and free password manager for all of your devices.</string>
|
||||
<key>SFSafariAppExtensionBundleIdentifiersToReplace</key>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<authors>Bitwarden Inc.</authors>
|
||||
<projectUrl>https://bitwarden.com/</projectUrl>
|
||||
<iconUrl>https://raw.githubusercontent.com/bitwarden/brand/master/icons/256x256.png</iconUrl>
|
||||
<copyright>Copyright © 2015-2024 Bitwarden Inc.</copyright>
|
||||
<copyright>Copyright © 2015-2025 Bitwarden Inc.</copyright>
|
||||
<projectSourceUrl>https://github.com/bitwarden/clients/</projectSourceUrl>
|
||||
<docsUrl>https://help.bitwarden.com/article/cli/</docsUrl>
|
||||
<bugTrackerUrl>https://github.com/bitwarden/clients/issues</bugTrackerUrl>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"productName": "Bitwarden",
|
||||
"appId": "com.bitwarden.desktop",
|
||||
"buildDependenciesFromSource": true,
|
||||
"copyright": "Copyright © 2015-2024 Bitwarden Inc.",
|
||||
"copyright": "Copyright © 2015-2025 Bitwarden Inc.",
|
||||
"directories": {
|
||||
"buildResources": "resources",
|
||||
"output": "dist",
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<authors>Bitwarden Inc.</authors>
|
||||
<projectUrl>https://bitwarden.com/</projectUrl>
|
||||
<iconUrl>https://raw.githubusercontent.com/bitwarden/brand/master/icons/256x256.png</iconUrl>
|
||||
<copyright>Copyright © 2015-2024 Bitwarden Inc.</copyright>
|
||||
<copyright>Copyright © 2015-2025 Bitwarden Inc.</copyright>
|
||||
<projectSourceUrl>https://github.com/bitwarden/clients/</projectSourceUrl>
|
||||
<docsUrl>https://bitwarden.com/help/</docsUrl>
|
||||
<bugTrackerUrl>https://github.com/bitwarden/clients/issues</bugTrackerUrl>
|
||||
|
||||
Reference in New Issue
Block a user