From 1aca257adffc0b0c1e39b0948e5df292d2f90fa6 Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Fri, 26 Jun 2026 16:37:36 -0400 Subject: [PATCH] chore(session): add feature flag to toggle on and make network state badge visible Signed-off-by: Brandon McAnsh --- .../com/flipcash/app/featureflags/FeatureFlag.kt | 11 +++++++++++ .../app/session/internal/RealSessionController.kt | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/apps/flipcash/shared/featureflags/src/main/kotlin/com/flipcash/app/featureflags/FeatureFlag.kt b/apps/flipcash/shared/featureflags/src/main/kotlin/com/flipcash/app/featureflags/FeatureFlag.kt index a15f634c5..385b2b065 100644 --- a/apps/flipcash/shared/featureflags/src/main/kotlin/com/flipcash/app/featureflags/FeatureFlag.kt +++ b/apps/flipcash/shared/featureflags/src/main/kotlin/com/flipcash/app/featureflags/FeatureFlag.kt @@ -248,6 +248,15 @@ sealed interface FeatureFlag { override val persistLogOut: Boolean = false } + @FeatureFlagMarker + data object ShowNetworkState: FeatureFlag { + 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> get() = FeatureFlagEntries.entries @@ -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 @@ -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" } diff --git a/apps/flipcash/shared/session/src/main/kotlin/com/flipcash/app/session/internal/RealSessionController.kt b/apps/flipcash/shared/session/src/main/kotlin/com/flipcash/app/session/internal/RealSessionController.kt index 0621da434..699573614 100644 --- a/apps/flipcash/shared/session/src/main/kotlin/com/flipcash/app/session/internal/RealSessionController.kt +++ b/apps/flipcash/shared/session/src/main/kotlin/com/flipcash/app/session/internal/RealSessionController.kt @@ -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)