diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/newchat/AddChannelView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/newchat/AddChannelView.kt index 7ad3076640..fe85a32e65 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/newchat/AddChannelView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/newchat/AddChannelView.kt @@ -38,20 +38,20 @@ import dev.icerock.moko.resources.compose.painterResource import kotlinx.coroutines.* @Composable -fun AddChannelView(chatModel: ChatModel, rh: RemoteHostInfo?, close: () -> Unit, closeAll: () -> Unit) { +fun ModalData.AddChannelView(chatModel: ChatModel, rh: RemoteHostInfo?, close: () -> Unit, closeAll: () -> Unit) { val rhId = rh?.remoteHostId val view = LocalMultiplatformView() val bottomSheetModalState = rememberModalBottomSheetState(initialValue = ModalBottomSheetValue.Hidden) val scope = rememberCoroutineScope() - val displayName = rememberSaveable { mutableStateOf("") } + val displayName = remember { stateGetOrPut("displayName") { "" } } val chosenImage = rememberSaveable { mutableStateOf(null) } val profileImage = rememberSaveable { mutableStateOf(null) } val focusRequester = remember { FocusRequester() } val hasRelays = rememberSaveable { mutableStateOf(true) } - val groupInfo = remember { mutableStateOf(null) } - val groupLink = rememberSaveable(stateSaver = GroupLink.nullableStateSaver) { mutableStateOf(null) } + val groupInfo = remember { stateGetOrPutNullable("groupInfo") { null } } + val groupLink = remember { stateGetOrPutNullable("groupLink") { null } } val groupRelays = remember { mutableStateOf>(emptyList()) } - val creationInProgress = rememberSaveable { mutableStateOf(false) } + val creationInProgress = remember { stateGetOrPut("creationInProgress") { false } } val showLinkStep = rememberSaveable { mutableStateOf(false) } val relayListExpanded = rememberSaveable { mutableStateOf(false) } @@ -664,6 +664,6 @@ fun RelayProgressIndicator(active: Int, total: Int) { @Composable fun PreviewAddChannelView() { SimpleXTheme { - AddChannelView(chatModel = ChatModel, rh = null, close = {}, closeAll = {}) + ModalData().AddChannelView(chatModel = ChatModel, rh = null, close = {}, closeAll = {}) } }