mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
favorite : apply pr review remarks
This commit is contained in:
+1
-1
@@ -20,5 +20,5 @@ sealed interface RoomDetailsEvent {
|
||||
data object LeaveRoom : RoomDetailsEvent
|
||||
data object MuteNotification : RoomDetailsEvent
|
||||
data object UnmuteNotification : RoomDetailsEvent
|
||||
data class SetIsFavorite(val isFavorite: Boolean) : RoomDetailsEvent
|
||||
data class SetFavorite(val isFavorite: Boolean) : RoomDetailsEvent
|
||||
}
|
||||
|
||||
+1
-1
@@ -124,7 +124,7 @@ class RoomDetailsPresenter @Inject constructor(
|
||||
client.notificationSettingsService().unmuteRoom(room.roomId, room.isEncrypted, room.isOneToOne)
|
||||
}
|
||||
}
|
||||
is RoomDetailsEvent.SetIsFavorite -> {
|
||||
is RoomDetailsEvent.SetFavorite -> {
|
||||
scope.launch {
|
||||
room.setIsFavorite(event.isFavorite)
|
||||
}
|
||||
|
||||
+1
-1
@@ -167,7 +167,7 @@ fun RoomDetailsView(
|
||||
FavoriteSection(
|
||||
isFavorite = state.isFavorite,
|
||||
onFavoriteChanges = {
|
||||
state.eventSink(RoomDetailsEvent.SetIsFavorite(it))
|
||||
state.eventSink(RoomDetailsEvent.SetFavorite(it))
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
+2
-2
@@ -438,9 +438,9 @@ class RoomDetailsPresenterTests {
|
||||
val presenter = createRoomDetailsPresenter(room = room)
|
||||
presenter.test {
|
||||
val initialState = awaitItem()
|
||||
initialState.eventSink(RoomDetailsEvent.SetIsFavorite(true))
|
||||
initialState.eventSink(RoomDetailsEvent.SetFavorite(true))
|
||||
assertThat(room.setIsFavoriteCalls).isEqualTo(listOf(true))
|
||||
initialState.eventSink(RoomDetailsEvent.SetIsFavorite(false))
|
||||
initialState.eventSink(RoomDetailsEvent.SetFavorite(false))
|
||||
assertThat(room.setIsFavoriteCalls).isEqualTo(listOf(true, false))
|
||||
cancelAndIgnoreRemainingEvents()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user