mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 01:45:52 +03:00
Fix room name reset issue when rotating the screen
This commit is contained in:
parent
dc8668b222
commit
613573931e
1 changed files with 7 additions and 6 deletions
|
@ -20,6 +20,7 @@ import android.content.Context
|
|||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.airbnb.mvrx.viewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
import im.vector.app.core.extensions.addFragment
|
||||
|
@ -58,19 +59,19 @@ class RoomDirectoryActivity : VectorBaseActivity() {
|
|||
.subscribe { sharedAction ->
|
||||
when (sharedAction) {
|
||||
is RoomDirectorySharedAction.Back -> onBackPressed()
|
||||
is RoomDirectorySharedAction.CreateRoom ->
|
||||
is RoomDirectorySharedAction.CreateRoom -> {
|
||||
addFragmentToBackstack(R.id.simpleFragmentContainer, CreateRoomFragment::class.java)
|
||||
// Transmit the filter to the createRoomViewModel
|
||||
withState(roomDirectoryViewModel) {
|
||||
createRoomViewModel.handle(CreateRoomAction.SetName(it.currentFilter))
|
||||
}
|
||||
}
|
||||
is RoomDirectorySharedAction.ChangeProtocol ->
|
||||
addFragmentToBackstack(R.id.simpleFragmentContainer, RoomDirectoryPickerFragment::class.java)
|
||||
is RoomDirectorySharedAction.Close -> finish()
|
||||
}
|
||||
}
|
||||
.disposeOnDestroy()
|
||||
|
||||
roomDirectoryViewModel.selectSubscribe(this, PublicRoomsViewState::currentFilter) { currentFilter ->
|
||||
// Transmit the filter to the createRoomViewModel
|
||||
createRoomViewModel.handle(CreateRoomAction.SetName(currentFilter))
|
||||
}
|
||||
}
|
||||
|
||||
override fun initUiAndData() {
|
||||
|
|
Loading…
Reference in a new issue