diff --git a/apps/browser/src/tools/popup/settings/about-page/about-page.component.html b/apps/browser/src/tools/popup/settings/about-page/about-page.component.html index 6f03fa108a..7acb4bd6aa 100644 --- a/apps/browser/src/tools/popup/settings/about-page/about-page.component.html +++ b/apps/browser/src/tools/popup/settings/about-page/about-page.component.html @@ -66,6 +66,15 @@
{{ "contactSupport" | i18n }}
+ diff --git a/apps/browser/src/tools/popup/settings/about-page/about-page.component.ts b/apps/browser/src/tools/popup/settings/about-page/about-page.component.ts index 58a8a179e4..bd5814c455 100644 --- a/apps/browser/src/tools/popup/settings/about-page/about-page.component.ts +++ b/apps/browser/src/tools/popup/settings/about-page/about-page.component.ts @@ -1,12 +1,28 @@ import { Component } from "@angular/core"; import { firstValueFrom } from "rxjs"; +import { DeviceType } from "@bitwarden/common/enums"; import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service"; +import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { DialogService } from "@bitwarden/components"; import { BrowserApi } from "../../../../platform/browser/browser-api"; import { AboutDialogComponent } from "../about-dialog/about-dialog.component"; +const RateUrls = { + [DeviceType.ChromeExtension]: + "https://chromewebstore.google.com/detail/bitwarden-free-password-m/nngceckbapebfimnlniiiahkandclblb/reviews", + [DeviceType.FirefoxExtension]: + "https://addons.mozilla.org/en-US/firefox/addon/bitwarden-password-manager/#reviews", + [DeviceType.OperaExtension]: + "https://addons.opera.com/en/extensions/details/bitwarden-free-password-manager/#feedback-container", + [DeviceType.EdgeExtension]: + "https://microsoftedge.microsoft.com/addons/detail/jbkfoedolllekgbhcbcoahefnbanhhlh", + [DeviceType.VivaldiExtension]: + "https://chromewebstore.google.com/detail/bitwarden-free-password-m/nngceckbapebfimnlniiiahkandclblb/reviews", + [DeviceType.SafariExtension]: "https://apps.apple.com/app/bitwarden/id1352778147", +}; + @Component({ selector: "app-about-page", templateUrl: "about-page.component.html", @@ -15,6 +31,7 @@ export class AboutPageComponent { constructor( private dialogService: DialogService, private environmentService: EnvironmentService, + private platformUtilsService: PlatformUtilsService, ) {} about() { @@ -44,4 +61,9 @@ export class AboutPageComponent { // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.createNewTab("https://bitwarden.com/getinvolved/"); } + + async rate() { + const deviceType = this.platformUtilsService.getDevice(); + await BrowserApi.createNewTab((RateUrls as any)[deviceType]); + } } diff --git a/apps/browser/src/tools/popup/settings/settings.component.html b/apps/browser/src/tools/popup/settings/settings.component.html index 65e14e052f..995a9c305c 100644 --- a/apps/browser/src/tools/popup/settings/settings.component.html +++ b/apps/browser/src/tools/popup/settings/settings.component.html @@ -97,17 +97,6 @@
{{ "about" | i18n }}
- - diff --git a/apps/browser/src/tools/popup/settings/settings.component.ts b/apps/browser/src/tools/popup/settings/settings.component.ts index 4e1751357b..58feaa30a5 100644 --- a/apps/browser/src/tools/popup/settings/settings.component.ts +++ b/apps/browser/src/tools/popup/settings/settings.component.ts @@ -3,7 +3,6 @@ import { Router } from "@angular/router"; import { Subject } from "rxjs"; import { VaultTimeoutService } from "@bitwarden/common/abstractions/vault-timeout/vault-timeout.service"; -import { DeviceType } from "@bitwarden/common/enums"; import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; @@ -13,20 +12,6 @@ import { DialogService } from "@bitwarden/components"; import { BrowserApi } from "../../../platform/browser/browser-api"; import BrowserPopupUtils from "../../../platform/popup/browser-popup-utils"; -const RateUrls = { - [DeviceType.ChromeExtension]: - "https://chromewebstore.google.com/detail/bitwarden-free-password-m/nngceckbapebfimnlniiiahkandclblb/reviews", - [DeviceType.FirefoxExtension]: - "https://addons.mozilla.org/en-US/firefox/addon/bitwarden-password-manager/#reviews", - [DeviceType.OperaExtension]: - "https://addons.opera.com/en/extensions/details/bitwarden-free-password-manager/#feedback-container", - [DeviceType.EdgeExtension]: - "https://microsoftedge.microsoft.com/addons/detail/jbkfoedolllekgbhcbcoahefnbanhhlh", - [DeviceType.VivaldiExtension]: - "https://chromewebstore.google.com/detail/bitwarden-free-password-m/nngceckbapebfimnlniiiahkandclblb/reviews", - [DeviceType.SafariExtension]: "https://apps.apple.com/app/bitwarden/id1352778147", -}; - @Component({ selector: "tools-settings", templateUrl: "settings.component.html", @@ -75,13 +60,6 @@ export class SettingsComponent implements OnInit { this.router.navigate(["/export"]); } - rate() { - const deviceType = this.platformUtilsService.getDevice(); - // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. - // eslint-disable-next-line @typescript-eslint/no-floating-promises - BrowserApi.createNewTab((RateUrls as any)[deviceType]); - } - ngOnDestroy() { this.destroy$.next(); this.destroy$.complete();