From 5da21fd27c39607720c9fc8458015ab27f625fa8 Mon Sep 17 00:00:00 2001 From: Antonio Bello Date: Fri, 6 Dec 2024 04:26:24 +0100 Subject: [PATCH] 631 Add feature toggle for storage alert feature (#639) https://github.com/Outblock/FRW-iOS/issues/631 Set the default value to false if the config property is not provided --- FRW/Services/Manager/Config/RemoteConfig.swift | 2 +- FRW/Services/Manager/TransactionManager.swift | 2 +- FRW/UI/Component/InsufficientStorageToastView.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/FRW/Services/Manager/Config/RemoteConfig.swift b/FRW/Services/Manager/Config/RemoteConfig.swift index 1290f7a0..1c3c26b4 100644 --- a/FRW/Services/Manager/Config/RemoteConfig.swift +++ b/FRW/Services/Manager/Config/RemoteConfig.swift @@ -209,7 +209,7 @@ extension RemoteConfigManager { return true case .insufficientStorage: // TODO: [AB] Not very elegant adding a dependency here, but implementing in a different way would probably require major refactoring - return WalletManager.shared.isStorageInsufficient && RemoteConfigManager.shared.config?.features.insufficientStorage ?? true + return WalletManager.shared.isStorageInsufficient && RemoteConfigManager.shared.config?.features.insufficientStorage ?? false default: return false } diff --git a/FRW/Services/Manager/TransactionManager.swift b/FRW/Services/Manager/TransactionManager.swift index be41a1bb..1893251a 100644 --- a/FRW/Services/Manager/TransactionManager.swift +++ b/FRW/Services/Manager/TransactionManager.swift @@ -266,7 +266,7 @@ extension TransactionManager { switch result.errorCode { case .storageCapacityExceeded: - if RemoteConfigManager.shared.config?.features.insufficientStorage ?? true { + if RemoteConfigManager.shared.config?.features.insufficientStorage ?? false { AlertViewController.showInsufficientStorageError(minimumBalance: WalletManager.shared.minimumStorageBalance.doubleValue) } default: diff --git a/FRW/UI/Component/InsufficientStorageToastView.swift b/FRW/UI/Component/InsufficientStorageToastView.swift index 7085fa14..ad530cb8 100644 --- a/FRW/UI/Component/InsufficientStorageToastView.swift +++ b/FRW/UI/Component/InsufficientStorageToastView.swift @@ -23,7 +23,7 @@ protocol InsufficientStorageToastViewModel: ObservableObject { } extension InsufficientStorageToastViewModel { - private var isInsufficientStorageEnabled: Bool { RemoteConfigManager.shared.config?.features.insufficientStorage ?? true } + private var isInsufficientStorageEnabled: Bool { RemoteConfigManager.shared.config?.features.insufficientStorage ?? false } var showInsufficientFundsToast: Bool { self.isInsufficientStorageEnabled && self.variant != nil