mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Code review fixes.
This commit is contained in:
parent
1124aa25fd
commit
dec62a893e
@ -224,7 +224,7 @@ class RoomMemberProfileFragment @Inject constructor(
|
||||
vectorBaseActivity.notImplemented("Mention")
|
||||
}
|
||||
|
||||
private fun handleShareRoomMemberProfile(permalink: String) = withState(viewModel) {
|
||||
private fun handleShareRoomMemberProfile(permalink: String) {
|
||||
startSharePlainTextIntent(fragment = this, chooserTitle = null, text = permalink)
|
||||
}
|
||||
}
|
||||
|
@ -237,8 +237,8 @@ class RoomMemberProfileViewModel @AssistedInject constructor(@Assisted private v
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleShareRoomMemberProfile() = withState { state ->
|
||||
PermalinkFactory.createPermalink(state.userId)?.let { permalink ->
|
||||
private fun handleShareRoomMemberProfile() {
|
||||
PermalinkFactory.createPermalink(initialState.userId)?.let { permalink ->
|
||||
_viewEvents.post(RoomMemberProfileViewEvents.ShareRoomMemberProfile(permalink))
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ import im.vector.riotx.R
|
||||
import im.vector.riotx.core.platform.VectorViewModel
|
||||
import im.vector.riotx.core.resources.StringProvider
|
||||
|
||||
class RoomProfileViewModel @AssistedInject constructor(@Assisted initialState: RoomProfileViewState,
|
||||
class RoomProfileViewModel @AssistedInject constructor(@Assisted private val initialState: RoomProfileViewState,
|
||||
private val stringProvider: StringProvider,
|
||||
private val session: Session)
|
||||
: VectorViewModel<RoomProfileViewState, RoomProfileAction, RoomProfileViewEvents>(initialState) {
|
||||
@ -67,7 +67,7 @@ class RoomProfileViewModel @AssistedInject constructor(@Assisted initialState: R
|
||||
override fun handle(action: RoomProfileAction) = when (action) {
|
||||
RoomProfileAction.LeaveRoom -> handleLeaveRoom()
|
||||
is RoomProfileAction.ChangeRoomNotificationState -> handleChangeNotificationMode(action)
|
||||
is RoomProfileAction.ShareRoomProfile -> handleShareRoomProfile()
|
||||
is RoomProfileAction.ShareRoomProfile -> handleShareRoomProfile()
|
||||
}
|
||||
|
||||
private fun handleChangeNotificationMode(action: RoomProfileAction.ChangeRoomNotificationState) {
|
||||
@ -91,8 +91,8 @@ class RoomProfileViewModel @AssistedInject constructor(@Assisted initialState: R
|
||||
})
|
||||
}
|
||||
|
||||
private fun handleShareRoomProfile() = withState { state ->
|
||||
PermalinkFactory.createPermalink(state.roomId)?.let { permalink ->
|
||||
private fun handleShareRoomProfile() {
|
||||
PermalinkFactory.createPermalink(initialState.roomId)?.let { permalink ->
|
||||
_viewEvents.post(RoomProfileViewEvents.ShareRoomProfile(permalink))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user