[PM-7662] Suppress welcome window on install when extension is in dev mode (#8864)

* suppress welcome window on install when extension is in dev mode

* use platformUtilsService.isDev instead of process.env.ENV

* use devFlags.skipWelcomeOnInstall instead of platformUtilsService.isDev

* update old dev_flags casing in base configs
This commit is contained in:
Jonathan Prusik 2024-05-06 15:25:41 -04:00 committed by GitHub
parent 425c7914b0
commit 6c21223466
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 10 additions and 6 deletions

View File

@ -1,5 +1,5 @@
{
"dev_flags": {},
"devFlags": {},
"flags": {
"showPasswordless": true,
"enableCipherKeyEncryption": false,

View File

@ -2,7 +2,8 @@
"devFlags": {
"managedEnvironment": {
"base": "https://localhost:8080"
}
},
"skipWelcomeOnInstall": true
},
"flags": {
"showPasswordless": true,

View File

@ -8,6 +8,7 @@ import { ConfigService } from "@bitwarden/common/platform/abstractions/config/co
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
import { SystemService } from "@bitwarden/common/platform/abstractions/system.service";
import { devFlagEnabled } from "@bitwarden/common/platform/misc/flags";
import { Utils } from "@bitwarden/common/platform/misc/utils";
import { CipherType } from "@bitwarden/common/vault/enums";
@ -324,9 +325,10 @@ export default class RuntimeBackground {
if (this.onInstalledReason != null) {
if (this.onInstalledReason === "install") {
// 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("https://bitwarden.com/browser-start/");
if (!devFlagEnabled("skipWelcomeOnInstall")) {
void BrowserApi.createNewTab("https://bitwarden.com/browser-start/");
}
await this.autofillSettingsService.setInlineMenuVisibility(
AutofillOverlayVisibility.OnFieldFocus,
);

View File

@ -1,5 +1,5 @@
{
"dev_flags": {},
"devFlags": {},
"flags": {
"multithreadDecryption": false,
"enableCipherKeyEncryption": false

View File

@ -10,6 +10,7 @@ export type SharedFlags = {
// eslint-disable-next-line @typescript-eslint/ban-types
export type SharedDevFlags = {
noopNotifications: boolean;
skipWelcomeOnInstall: boolean;
};
function getFlags<T>(envFlags: string | T): T {