Skip to content

Commit e8afdf4

Browse files
authored
chore(session): add feature flag to toggle on and make network state badge visible (#1005)
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 2386cc8 commit e8afdf4

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

apps/flipcash/shared/featureflags/src/main/kotlin/com/flipcash/app/featureflags/FeatureFlag.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,15 @@ sealed interface FeatureFlag<T: Any> {
248248
override val persistLogOut: Boolean = false
249249
}
250250

251+
@FeatureFlagMarker
252+
data object ShowNetworkState: FeatureFlag<Boolean> {
253+
override val key: String = "show_network_state_enabled"
254+
override val default: Boolean = false
255+
override val launched: Boolean = false
256+
override val visible: Boolean = true
257+
override val persistLogOut: Boolean = false
258+
}
259+
251260
companion object {
252261
val entries: List<FeatureFlag<*>>
253262
get() = FeatureFlagEntries.entries
@@ -284,6 +293,7 @@ val FeatureFlag<*>.title: String
284293
FeatureFlag.NavBar -> "Navigation Bar"
285294
FeatureFlag.GiveUsdf -> "Give/Send USDF"
286295
FeatureFlag.DepositFirstUX -> "Deposit First UX"
296+
FeatureFlag.ShowNetworkState -> "Network Offline Indicator"
287297
}
288298

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

316327

apps/flipcash/shared/session/src/main/kotlin/com/flipcash/app/session/internal/RealSessionController.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ class RealSessionController @Inject constructor(
204204
.onEach { autoStart -> stateHolder.update { it.copy(autoStartCamera = autoStart) } }
205205
.launchIn(scope)
206206

207+
featureFlagController.observe(FeatureFlag.ShowNetworkState)
208+
.onEach { enabled -> stateHolder.update { it.copy(showNetworkOffline = enabled) } }
209+
.launchIn(scope)
210+
207211
featureFlagController.observe(FeatureFlag.VibrateOnScan)
208212
.onEach { enabled -> stateHolder.update { it.copy(vibrateOnScan = enabled) } }
209213
.launchIn(scope)

0 commit comments

Comments
 (0)