mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-21 19:55:07 +01:00
refactor
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
parent
9155c4ca69
commit
98adab723b
@ -256,8 +256,6 @@ class ChatActivity :
|
||||
lateinit var chatViewModel: ChatViewModel
|
||||
lateinit var messageInputViewModel: MessageInputViewModel
|
||||
|
||||
private lateinit var noteToSelfRoomToken: String
|
||||
|
||||
private val startSelectContactForResult = registerForActivityResult(
|
||||
ActivityResultContracts
|
||||
.StartActivityForResult()
|
||||
@ -642,27 +640,6 @@ class ChatActivity :
|
||||
}
|
||||
}
|
||||
|
||||
chatViewModel.noteToSelfViewState.observe(this) { state ->
|
||||
|
||||
when (state) {
|
||||
is ChatViewModel.NoteToSelfErrorState -> {
|
||||
Snackbar.make(binding.root, "Unable to send message to note to self", Snackbar.LENGTH_LONG).show()
|
||||
}
|
||||
ChatViewModel.NoteToSelfStartState -> {
|
||||
}
|
||||
is ChatViewModel.NoteToSelfSuccessState -> {
|
||||
val roomOverall = state.roomOverall
|
||||
noteToSelfRoomToken = roomOverall.ocs?.data?.token!!
|
||||
}
|
||||
|
||||
is ChatViewModel.NoteToSelfNotAvailableState -> {
|
||||
}
|
||||
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
chatViewModel.joinRoomViewState.observe(this) { state ->
|
||||
when (state) {
|
||||
is ChatViewModel.JoinRoomSuccessState -> {
|
||||
|
@ -557,7 +557,7 @@ class ChatViewModel @Inject constructor(
|
||||
}
|
||||
|
||||
override fun onError(e: Throwable) {
|
||||
Log.e(TAG, "Error when sharing location to notes $e")
|
||||
Log.e(TAG, "Error when getting note to self room $e")
|
||||
_noteToSelfViewState.value = NoteToSelfErrorState(e.localizedMessage ?: "")
|
||||
}
|
||||
|
||||
|
@ -192,9 +192,6 @@ class MessageActionsDialog(
|
||||
noteToSelfRoomToken = roomOverall.ocs?.data?.token!!
|
||||
}
|
||||
|
||||
is ChatViewModel.NoteToSelfNotAvailableState -> {
|
||||
}
|
||||
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user