diff --git a/app/src/main/java/com/nextcloud/talk/chat/viewmodels/ChatViewModel.kt b/app/src/main/java/com/nextcloud/talk/chat/viewmodels/ChatViewModel.kt index 39a09bdcb..6b80b3d91 100644 --- a/app/src/main/java/com/nextcloud/talk/chat/viewmodels/ChatViewModel.kt +++ b/app/src/main/java/com/nextcloud/talk/chat/viewmodels/ChatViewModel.kt @@ -141,12 +141,12 @@ class ChatViewModel @Inject constructor( val getReminderExistState: LiveData get() = _getReminderExistState - object NoteToSelfNotAvaliableState : ViewState - open class NoteToSelfAvaliableState(val roomToken: String) : ViewState + object NoteToSelfNotAvailableState : ViewState + open class NoteToSelfAvailableState(val roomToken: String) : ViewState - private val _getNoteToSelfAvaliability: MutableLiveData = MutableLiveData(NoteToSelfNotAvaliableState) - val getNoteToSelfAvaliability: LiveData - get() = _getNoteToSelfAvaliability + private val _getNoteToSelfAvailability: MutableLiveData = MutableLiveData(NoteToSelfNotAvailableState) + val getNoteToSelfAvailability: LiveData + get() = _getNoteToSelfAvailability object GetRoomStartState : ViewState object GetRoomErrorState : ViewState @@ -732,9 +732,9 @@ class ChatViewModel @Inject constructor( val model = ConversationModel.mapToConversationModel(it, userProvider.currentUser.blockingGet()) ConversationUtils.isNoteToSelfConversation(model) } - _getNoteToSelfAvaliability.value = NoteToSelfAvaliableState(noteToSelf.token!!) + _getNoteToSelfAvailability.value = NoteToSelfAvailableState(noteToSelf.token!!) } catch (e: NoSuchElementException) { - _getNoteToSelfAvaliability.value = NoteToSelfNotAvaliableState + _getNoteToSelfAvailability.value = NoteToSelfNotAvailableState Log.e(TAG, "Note to self not found $e") } } diff --git a/app/src/main/java/com/nextcloud/talk/ui/dialog/MessageActionsDialog.kt b/app/src/main/java/com/nextcloud/talk/ui/dialog/MessageActionsDialog.kt index 88a84fcf9..0a4445ca2 100644 --- a/app/src/main/java/com/nextcloud/talk/ui/dialog/MessageActionsDialog.kt +++ b/app/src/main/java/com/nextcloud/talk/ui/dialog/MessageActionsDialog.kt @@ -120,9 +120,9 @@ class MessageActionsDialog( ), false ) - chatActivity.chatViewModel.getNoteToSelfAvaliability.observe(this) { state -> + chatActivity.chatViewModel.getNoteToSelfAvailability.observe(this) { state -> when (state) { - is ChatViewModel.NoteToSelfAvaliableState -> { + is ChatViewModel.NoteToSelfAvailableState -> { initMenuAddToNote( !message.isDeleted && !ConversationUtils.isNoteToSelfConversation(currentConversation), state.roomToken