Skip to content

Commit

Permalink
fix: persistent ws not reflected in UI (WPB-7020) (#2770)
Browse files Browse the repository at this point in the history
  • Loading branch information
yamilmedina committed Mar 6, 2024
1 parent a1dae98 commit 3dae65c
Showing 1 changed file with 10 additions and 14 deletions.
Expand Up @@ -22,7 +22,6 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
Expand Down Expand Up @@ -75,19 +74,16 @@ fun NetworkSettingsScreenContent(
.fillMaxSize()
.padding(internalPadding)
) {
val appContext = LocalContext.current.applicationContext
val isWebSocketEnforcedByDefault = remember {
isWebsocketEnabledByDefault(appContext)
}
val switchState = remember {
if (isWebSocketEnforcedByDefault) {
SwitchState.TextOnly(true)
} else {
SwitchState.Enabled(
value = isWebSocketEnabled,
onCheckedChange = setWebSocketState
)
}
val appContext = LocalContext.current
val isWebSocketEnforcedByDefault = isWebsocketEnabledByDefault(appContext)

val switchState = if (isWebSocketEnforcedByDefault) {
SwitchState.TextOnly(true)
} else {
SwitchState.Enabled(
value = isWebSocketEnabled,
onCheckedChange = setWebSocketState
)
}

GroupConversationOptionsItem(
Expand Down

0 comments on commit 3dae65c

Please sign in to comment.