Skip to content

Commit

Permalink
631 Add feature toggle for storage alert feature (#639)
Browse files Browse the repository at this point in the history
#631

Set the default value to false if the config property is not provided
  • Loading branch information
jeden authored Dec 6, 2024
1 parent 36fa19a commit 5da21fd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion FRW/Services/Manager/Config/RemoteConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion FRW/Services/Manager/TransactionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion FRW/UI/Component/InsufficientStorageToastView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5da21fd

Please sign in to comment.