feat(@desktop/wallet): Add connector Feature Flag (#15551)

fixes #15550
This commit is contained in:
Godfrain Jacques 2024-07-11 10:56:48 -07:00 committed by GitHub
parent 1e146b76e7
commit 40fe6d5de2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 0 deletions

View File

@ -3,6 +3,7 @@ import os
const DEFAULT_FLAG_DAPPS_ENABLED = false
const DEFAULT_FLAG_SWAP_ENABLED = false
const DEFAULT_FLAG_CONNECTOR_ENABLED = false
proc boolToEnv(defaultValue: bool): string =
return if defaultValue: "1" else: "0"
@ -11,11 +12,13 @@ QtObject:
type FeatureFlags* = ref object of QObject
dappsEnabled: bool
swapEnabled: bool
connectorEnabled: bool
proc setup(self: FeatureFlags) =
self.QObject.setup()
self.dappsEnabled = getEnv("FLAG_DAPPS_ENABLED", boolToEnv(DEFAULT_FLAG_DAPPS_ENABLED)) != "0"
self.swapEnabled = getEnv("FLAG_SWAP_ENABLED", boolToEnv(DEFAULT_FLAG_SWAP_ENABLED)) != "0"
self.connectorEnabled = getEnv("FLAG_CONNECTOR_ENABLED", boolToEnv(DEFAULT_FLAG_CONNECTOR_ENABLED)) != "0"
proc delete*(self: FeatureFlags) =
self.QObject.delete()
@ -35,3 +38,9 @@ QtObject:
QtProperty[bool] swapEnabled:
read = getSwapEnabled
proc getConnectorEnabled*(self: FeatureFlags): bool {.slot.} =
return self.connectorEnabled
QtProperty[bool] connectorEnabled:
read = getConnectorEnabled