Skip to content

Commit

Permalink
chore(beta): make TIP_CARD_ON_HOMESCREEN immutable
Browse files Browse the repository at this point in the history
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
  • Loading branch information
bmc08gt committed Aug 22, 2024
1 parent 7ed765c commit 36525b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 5 additions & 4 deletions api/src/main/java/com/getcode/model/PrefBool.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ sealed interface InternalRouting
sealed interface AppSetting
sealed interface BetaFlag
sealed interface DevSetting
sealed interface Immutable


sealed class PrefsBool(val value: String) {
Expand Down Expand Up @@ -43,15 +44,15 @@ sealed class PrefsBool(val value: String) {
data object DISPLAY_ERRORS: PrefsBool("debug_display_errors"), BetaFlag
data object SHOW_CONNECTIVITY_STATUS: PrefsBool("debug_no_network"), BetaFlag
data object GIVE_REQUESTS_ENABLED: PrefsBool("give_requests_enabled"), BetaFlag
data object BUY_MODULE_ENABLED : PrefsBool("buy_kin_enabled"), BetaFlag
data object BUY_MODULE_ENABLED : PrefsBool("buy_kin_enabled"), BetaFlag, Immutable
data object CHAT_UNSUB_ENABLED: PrefsBool("chat_unsub_enabled"), BetaFlag
data object TIPS_ENABLED : PrefsBool("tips_enabled"), BetaFlag
data object TIPS_ENABLED : PrefsBool("tips_enabled"), BetaFlag, Immutable
data object CONVERSATIONS_ENABLED: PrefsBool("conversations_enabled"), BetaFlag
data object CONVERSATION_CASH_ENABLED: PrefsBool("convo_cash_enabled"), BetaFlag
data object BALANCE_CURRENCY_SELECTION_ENABLED: PrefsBool("balance_currency_enabled"), BetaFlag
data object BALANCE_CURRENCY_SELECTION_ENABLED: PrefsBool("balance_currency_enabled"), BetaFlag, Immutable
data object KADO_WEBVIEW_ENABLED : PrefsBool("kado_inapp_enabled"), BetaFlag
data object SHARE_TWEET_TO_TIP : PrefsBool("share_tweet_to_tip"), BetaFlag
data object TIP_CARD_ON_HOMESCREEN: PrefsBool("tip_card_on_home_screen"), BetaFlag
data object TIP_CARD_ON_HOMESCREEN: PrefsBool("tip_card_on_home_screen"), BetaFlag, Immutable
}

val APP_SETTINGS: List<AppSetting> = listOf(PrefsBool.CAMERA_START_BY_DEFAULT, PrefsBool.REQUIRE_BIOMETRICS)
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import com.getcode.R
import com.getcode.model.Immutable
import com.getcode.model.PrefsBool
import com.getcode.network.repository.BetaOptions
import com.getcode.theme.CodeTheme
Expand Down Expand Up @@ -158,9 +159,7 @@ fun BetaFlagsScreen(

private fun BetaOptions.canMutate(flag: PrefsBool): Boolean {
return when (flag) {
PrefsBool.BUY_MODULE_ENABLED -> false
PrefsBool.BALANCE_CURRENCY_SELECTION_ENABLED -> false
PrefsBool.TIPS_ENABLED -> false
is Immutable -> false
PrefsBool.CONVERSATION_CASH_ENABLED -> conversationsEnabled
else -> true
}
Expand Down

0 comments on commit 36525b4

Please sign in to comment.