Remove uninstalled apps from hidden apps list

This commit is contained in:
Suphon Thanakornpakapong committed 2021-06-04 21:06:00 +07:00
1 parent 6cbb201010
commit 03b9917331
1 file changed
+11 -1
@@ -63,7 +63,17 @@ fun HiddenAppsPreferences() {
val apps = optionalApps.get()
val toggleHiddenApp = { app: App ->
val key = app.key.toString()
if (hiddenApps.contains(key)) hiddenApps -= key else hiddenApps += key
val newSet = apps
.filter { hiddenApps.contains(it.key.toString()) }
.map { it.key.toString() }
.toMutableSet()
val isHidden = !hiddenApps.contains(key)
if (isHidden) {
newSet.add(key)
} else {
newSet.remove(key)
}
hiddenApps = newSet
}
PreferenceLayoutLazyColumn {
preferenceGroupItems(apps, isFirstChild = true) { index, app ->