code review
This commit is contained in:
parent
8e6e6736a3
commit
4f5632b916
@ -166,19 +166,18 @@ class MatrixToBottomSheetViewModel @AssistedInject constructor(
|
|||||||
enableEncryptionIfInvitedUsersSupportIt = adminE2EByDefault
|
enableEncryptionIfInvitedUsersSupportIt = adminE2EByDefault
|
||||||
}
|
}
|
||||||
|
|
||||||
val roomId =
|
val roomId = try {
|
||||||
try {
|
awaitCallback<String> { session.createRoom(roomParams, it) }
|
||||||
awaitCallback<String> { session.createRoom(roomParams, it) }.also {
|
|
||||||
setState {
|
|
||||||
copy(startChattingState = Success(Unit))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (failure: Throwable) {
|
} catch (failure: Throwable) {
|
||||||
setState {
|
setState {
|
||||||
copy(startChattingState = Fail(Exception(stringProvider.getString(R.string.invite_users_to_room_failure))))
|
copy(startChattingState = Fail(Exception(stringProvider.getString(R.string.invite_users_to_room_failure))))
|
||||||
}
|
}
|
||||||
return@launch
|
return@launch
|
||||||
}
|
}
|
||||||
|
setState {
|
||||||
|
// we can hide this button has we will navigate out
|
||||||
|
copy(startChattingState = Uninitialized)
|
||||||
|
}
|
||||||
_viewEvents.post(MatrixToViewEvents.NavigateToRoom(roomId))
|
_viewEvents.post(MatrixToViewEvents.NavigateToRoom(roomId))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user