Skip to content

Commit

Permalink
Finish MediaPreviewV2Activity when jumping to a message.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholas-signal authored and greyson-signal committed Jan 27, 2023
1 parent 71ecba1 commit 31bcc2e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,10 @@ class MediaPreviewV2Fragment : LoggingFragment(R.layout.fragment_media_preview_v
if (messageId != null) {
binding.toolbar.setOnClickListener { v ->
viewModel.jumpToFragment(v.context, messageId).subscribeBy(
onSuccess = { startActivity(it) },
onSuccess = {
startActivity(it)
requireActivity().finish()
},
onError = {
Log.e(TAG, "Could not find message position for message ID: $messageId", it)
Toast.makeText(v.context, R.string.MediaPreviewActivity_error_finding_message, Toast.LENGTH_LONG).show()
Expand Down

0 comments on commit 31bcc2e

Please sign in to comment.