mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-23 21:33:47 +00:00
android, desktop: gaurd crashes when item is absent in the list (#6140)
This commit is contained in:
1 parent
9a8ed40082
commit
d3a5936d17
6 files changed
+13
-10
No files matched your search
+2
-2
@@ -159,11 +159,11 @@ fun AppearanceScope.AppearanceLayout(
|
||||
}
|
||||
}
|
||||
|
||||
private fun findEnabledIcon(): AppIcon = AppIcon.values().first { icon ->
|
||||
private fun findEnabledIcon(): AppIcon = AppIcon.values().firstOrNull { icon ->
|
||||
androidAppContext.packageManager.getComponentEnabledSetting(
|
||||
ComponentName(APPLICATION_ID, "chat.simplex.app.MainActivity_${icon.name.lowercase()}")
|
||||
).let { it == COMPONENT_ENABLED_STATE_DEFAULT || it == COMPONENT_ENABLED_STATE_ENABLED }
|
||||
}
|
||||
} ?: AppIcon.DEFAULT
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
|
||||
Reference in new issue
Block a user