Bimba.git

commit 2810f1d7cfd8ee7561f246e93f93e2f05e91ed66

Author: Adam Pioterek <adam.pioterek@protonmail.ch>

fix: favourites in main activity show all lines

 app/src/main/java/ml/adamsprogs/bimba/models/StopSegment.kt | 8 ++++++


diff --git a/app/src/main/java/ml/adamsprogs/bimba/models/StopSegment.kt b/app/src/main/java/ml/adamsprogs/bimba/models/StopSegment.kt
index 50f2fb4860b39f77025541cb341a46a18ab93e2c..12096f90b1067602d0e911ae37e1c03e92b2928d 100644
--- a/app/src/main/java/ml/adamsprogs/bimba/models/StopSegment.kt
+++ b/app/src/main/java/ml/adamsprogs/bimba/models/StopSegment.kt
@@ -65,7 +65,13 @@
     fun remove(plateId: Plate.ID): Boolean {
         if (plates == null)
             return false
-        return (plates as HashSet).remove(plateId)
+
+        plates = plates!!.asSequence().filter { it != plateId }.toSet()
+        println("after remove:")
+        plates!!.forEach {
+            println(it)
+        }
+        return true
     }
 
     override fun toString(): String {