chore: add featureFlag for integrationtestenv derived from process.env

This commit is contained in:
Audric Ackermann 2023-08-17 14:46:33 +10:00
parent 1cff5e467f
commit 3c8ab8906a
3 changed files with 5 additions and 1 deletions

View File

@ -31,6 +31,9 @@ window.sessionFeatureFlags = {
useTestNet: Boolean(
process.env.NODE_APP_INSTANCE && process.env.NODE_APP_INSTANCE.includes('testnet')
),
integrationTestEnv: Boolean(
process.env.NODE_APP_INSTANCE && process.env.NODE_APP_INSTANCE.includes('test-integration')
),
useClosedGroupV3: false || process.env.USE_CLOSED_GROUP_V3,
debug: {
debugLogging: !_.isEmpty(process.env.SESSION_DEBUG),

View File

@ -140,7 +140,7 @@ export async function autoScaleAvatarBlob(file: File) {
* Shows the system file picker for images, scale the image down for avatar/opengroup measurements and return the blob objectURL on success
*/
export async function pickFileForAvatar(): Promise<string | null> {
if (process.env.NODE_APP_INSTANCE?.includes('test-integration')) {
if (window.sessionFeatureFlags.integrationTestEnv) {
window.log.info(
'shorting pickFileForAvatar as it does not work in playwright/notsending the filechooser event'
);

1
ts/window.d.ts vendored
View File

@ -34,6 +34,7 @@ declare global {
useOnionRequests: boolean;
useTestNet: boolean;
useClosedGroupV3: boolean;
integrationTestEnv: boolean;
debug: {
debugLogging: boolean;
debugLibsessionDumps: boolean;