make sure we always hide the proper icon

This commit is contained in:
tibbi 2022-10-26 17:10:01 +02:00
parent 54b4b46da3
commit e4b10b4013

View File

@ -62,8 +62,8 @@ class LaunchersAdapter(
fun hideIcon(item: HomeScreenGridItem) {
val itemToRemove = launchers.firstOrNull { it.getLauncherIdentifier() == item.getItemIdentifier() }
if (itemToRemove != null) {
val position = launchers.indexOf(itemToRemove)
launchers.remove(itemToRemove)
val position = launchers.indexOfFirst { it.getLauncherIdentifier() == item.getItemIdentifier() }
launchers.removeAt(position)
notifyItemRemoved(position)
}
}