feat(@desktop/wallet): Add connector Feature Flag (#15551)
fixes #15550
This commit is contained in:
parent
1e146b76e7
commit
40fe6d5de2
|
@ -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
|
Loading…
Reference in New Issue