Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #13936 - Finish StoryActivity if Story was already deleted #13938

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Sagar0-0
Copy link
Contributor

Closes #13936

First time contributor checklist

Contributor checklist

  • Device A, Android X.Y.Z
  • Device B, Android Z.Y
  • Virtual device W, Android Y.Y.Z
  • My contribution is fully baked and ready to be merged as is
  • I ensure that all the open issues my contribution fixes are mentioned in the commit message of my first commit using the Fixes #1234 syntax

Description

Fixes:
Closes the StoryActivty if onQuoteClick has a deleted message's ID.

Improvements:

  1. Start this StoryActivity for result, and if the result from StoryViewerFragment says that the story message is deleted, then after receiving that result in ChaFragment, update that paticular message's state.
    Should I use onActivityResult? or launcher?
    Is it fine to update the message state from this callback?

  2. Add a callback listening to deletion of story.

Comment on lines +160 to +162
private fun finish() {
requireActivity().finish()
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need a function for this, calling requireActivity().finish() directly is fine

@@ -116,6 +118,11 @@ class StoryViewerFragment :
requireActivity().supportStartPostponedEnterTransition()
}

if (state.crossfadeTarget is StoryViewerState.CrossfadeTarget.None) {
toast(R.string.ConversationFragment_quoted_message_not_found)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function moves the toast to the main thread, implying that there's a concern this isn't running on the main thread already. There's lot of other view stuff happening in this function, are we sure it's not running on the main thread?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Crash on clicking (Deleted)Story Reply
2 participants