Fixed delete conversation history not updating chat messages list after going back

This commit is contained in:
Sylvain Berfini 2023-11-19 20:42:16 +01:00
parent ce1cb3a15a
commit d58edf0614
3 changed files with 13 additions and 0 deletions

View file

@ -433,6 +433,13 @@ class ConversationFragment : GenericFragment() {
}
}
sharedViewModel.forceRefreshConversationEvent.observe(viewLifecycleOwner) {
it.consume {
Log.i("$TAG Force refreshing chat messages list")
viewModel.applyFilter("")
}
}
binding.sendArea.messageToSend.setControlEnterListener(object :
RichEditText.RichEditTextSendListener {
override fun onControlEnterPressedAndReleased() {

View file

@ -114,6 +114,7 @@ class ConversationInfoFragment : GenericFragment() {
(view.parent as? ViewGroup)?.doOnPreDraw {
Log.e("$TAG Failed to find chat room, going back")
goBack()
// TODO: show toast ?
}
}
}
@ -139,6 +140,7 @@ class ConversationInfoFragment : GenericFragment() {
it.consume {
// TODO: show toast ?
Log.i("$TAG History has been deleted, leaving conversation info...")
sharedViewModel.forceRefreshConversationEvent.value = Event(true)
goBack()
}
}

View file

@ -110,6 +110,10 @@ class SharedMainViewModel @UiThread constructor() : ViewModel() {
// When using keyboard to share gif or other, see RichContentReceiver & RichEditText classes
val richContentUri = MutableLiveData<Event<Uri>>()
val forceRefreshConversationEvent: MutableLiveData<Event<Boolean>> by lazy {
MutableLiveData<Event<Boolean>>()
}
/* Meetings related */
val forceRefreshMeetingsListEvent: MutableLiveData<Event<Boolean>> by lazy {