From 40fe6d5de22c3b880e93350d17d1e778538a2cd2 Mon Sep 17 00:00:00 2001 From: Godfrain Jacques Date: Thu, 11 Jul 2024 10:56:48 -0700 Subject: [PATCH] feat(@desktop/wallet): Add connector Feature Flag (#15551) fixes #15550 --- src/app/global/feature_flags.nim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/app/global/feature_flags.nim b/src/app/global/feature_flags.nim index e6bef8f717..83b1607432 100644 --- a/src/app/global/feature_flags.nim +++ b/src/app/global/feature_flags.nim @@ -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 \ No newline at end of file