diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/protection/TimelineProtectionStore.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/protection/TimelineProtectionStore.kt index fe0c753fac..019f4eabd6 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/protection/TimelineProtectionStore.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/protection/TimelineProtectionStore.kt @@ -7,7 +7,7 @@ package io.element.android.features.messages.impl.timeline.protection -import androidx.compose.runtime.mutableStateSetOf +import androidx.compose.runtime.mutableStateOf import dev.zacsweers.metro.ContributesBinding import dev.zacsweers.metro.SingleIn import io.element.android.libraries.di.SessionScope @@ -21,11 +21,11 @@ interface TimelineProtectionStore { @ContributesBinding(SessionScope::class) @SingleIn(SessionScope::class) class DefaultTimelineProtectionStore : TimelineProtectionStore { - private val allowedEvents = mutableStateSetOf() + private val allowedEvents = mutableStateOf(emptySet()) - override val allowedEventIds: Set = allowedEvents + override val allowedEventIds: Set get() = allowedEvents.value override fun allowEvent(eventId: EventId) { - allowedEvents += eventId + allowedEvents.value = allowedEvents.value + eventId } }