make a call to endpoint when Add to Notes is clicked

Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
sowjanyakch 2025-04-28 11:27:31 +02:00
parent 98adab723b
commit 31aa56d85c
No known key found for this signature in database
GPG Key ID: F7AA2A8B65B50220

View File

@ -185,13 +185,13 @@ class MessageActionsDialog(
when (state) {
is ChatViewModel.NoteToSelfErrorState -> {
}
ChatViewModel.NoteToSelfStartState -> {
is ChatViewModel.NoteToSelfStartState -> {
}
is ChatViewModel.NoteToSelfSuccessState -> {
val roomOverall = state.roomOverall
noteToSelfRoomToken = roomOverall.ocs?.data?.token!!
chatActivity.shareToNotes(message, noteToSelfRoomToken)
}
else -> {
}
}
@ -473,13 +473,11 @@ class MessageActionsDialog(
private fun initMenuAddToNote(visible: Boolean) {
if (visible) {
chatViewModel.checkForNoteToSelf(user!!)
dialogMessageActionsBinding.menuShareToNote.setOnClickListener {
chatActivity.shareToNotes(message, noteToSelfRoomToken)
dismiss()
}
}
dialogMessageActionsBinding.menuShareToNote.visibility = getVisibility(visible)
}