Skip to content

Commit

Permalink
remember migrate screen's obsolete option (#529)
Browse files Browse the repository at this point in the history
* remember migrate screen's obsolete option

* also filter not-installed source
  • Loading branch information
cuong-tran committed Nov 25, 2024
1 parent ca1330d commit 6d6fb8d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand Down Expand Up @@ -112,7 +112,7 @@ private fun MigrateSourceList(
) {
// KMK -->
val lazyListState = rememberLazyListState()
var filterObsoleteSource by remember { mutableStateOf(false) }
var filterObsoleteSource by rememberSaveable { mutableStateOf(false) }

BackHandler(enabled = !state.searchQuery.isNullOrBlank()) {
onChangeSearchQuery("")
Expand Down Expand Up @@ -190,7 +190,7 @@ private fun MigrateSourceList(
}

items(
items = list.filter { !filterObsoleteSource || it.first.installedExtension?.isObsolete == true },
items = list.filter { !filterObsoleteSource || it.first.installedExtension?.isObsolete != false },
key = { (source, _) -> "migrate-${source.id}" },
) { (source, count) ->
MigrateSourceItem(
Expand Down

0 comments on commit 6d6fb8d

Please sign in to comment.