Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,15 @@ sealed interface FeatureFlag<T: Any> {
override val persistLogOut: Boolean = false
}

@FeatureFlagMarker
data object ShowNetworkState: FeatureFlag<Boolean> {
override val key: String = "show_network_state_enabled"
override val default: Boolean = false
override val launched: Boolean = false
override val visible: Boolean = true
override val persistLogOut: Boolean = false
}

companion object {
val entries: List<FeatureFlag<*>>
get() = FeatureFlagEntries.entries
Expand Down Expand Up @@ -284,6 +293,7 @@ val FeatureFlag<*>.title: String
FeatureFlag.NavBar -> "Navigation Bar"
FeatureFlag.GiveUsdf -> "Give/Send USDF"
FeatureFlag.DepositFirstUX -> "Deposit First UX"
FeatureFlag.ShowNetworkState -> "Network Offline Indicator"
}

val FeatureFlag<*>.message: String
Expand Down Expand Up @@ -311,6 +321,7 @@ val FeatureFlag<*>.message: String
FeatureFlag.NavBar -> "Customize the order and labels of navigation bar buttons"
FeatureFlag.GiveUsdf -> "When enabled, you'll gain the ability to send USDF directly and give it as cash"
FeatureFlag.DepositFirstUX -> "When enabled, the user experience for new and empty accounts will be centered around depositing funds"
FeatureFlag.ShowNetworkState -> "When enabled, you'll gain the ability to see the network state on the Scanner when offline"
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ class RealSessionController @Inject constructor(
.onEach { autoStart -> stateHolder.update { it.copy(autoStartCamera = autoStart) } }
.launchIn(scope)

featureFlagController.observe(FeatureFlag.ShowNetworkState)
.onEach { enabled -> stateHolder.update { it.copy(showNetworkOffline = enabled) } }
.launchIn(scope)

featureFlagController.observe(FeatureFlag.VibrateOnScan)
.onEach { enabled -> stateHolder.update { it.copy(vibrateOnScan = enabled) } }
.launchIn(scope)
Expand Down
Loading