diff --git a/shared/src/commonMain/kotlin/com/wbrawner/twigs/shared/Repository.kt b/shared/src/commonMain/kotlin/com/wbrawner/twigs/shared/Repository.kt index c76476c..19dd178 100644 --- a/shared/src/commonMain/kotlin/com/wbrawner/twigs/shared/Repository.kt +++ b/shared/src/commonMain/kotlin/com/wbrawner/twigs/shared/Repository.kt @@ -18,7 +18,7 @@ interface Identifiable { } inline fun MutableList.replace(item: T) { - val index = indexOf(item) + val index = indexOfFirst { it.id == item.id } if (index > -1) { removeAt(index) }