Fix theme setting dialog not surviving configuration changes

This commit is contained in:
zt64 2022-08-29 14:37:14 -04:00
parent 628b331a0c
commit 5bb5a38981

View file

@ -12,6 +12,7 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.*
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
@ -200,7 +201,7 @@ fun ThemeDialog(
onDismissRequest: () -> Unit,
onConfirm: (Theme) -> Unit
) {
var selectedTheme by remember { mutableStateOf(currentTheme) }
var selectedTheme by rememberSaveable { mutableStateOf(currentTheme) }
AlertDialog(
onDismissRequest = onDismissRequest,