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

Fix create post snackbar error message #1603

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

hjiangsu
Copy link
Member

Pull Request Description

This PR should fix the error message when displaying the snackbar after creating a new post. I just added a conditional to check if the FeedBloc is present within the tree, and trigger the FeedItemUpdatedEvent only if its available.

Issue Being Fixed

Issue Number: N/A

Screenshots / Recordings

Checklist

  • If a new package was added, did you ensure it uses an appropriate license and is actively maintained?
  • Did you use localized strings (and added appropriate descriptions) where applicable?
  • Did you add semanticLabels where applicable for accessibility?

Copy link
Member

@micahmo micahmo left a comment

Choose a reason for hiding this comment

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

LGTM! Although is it expected for feedBloc to be null when creating a post from the main feed page?

@hjiangsu
Copy link
Member Author

I just checked the logic again, and there are cases where we might not have the FeedBloc in the widget tree, the main one being the FeedFAB. The FAB is located above the FeedPage (in thunder_page.dart), which means that it likely doesn't have the FeedBloc context (and thus, why it was triggering the error)

We may need to solve this issue in a different PR, but it doesn't seem like it affects anything major at the moment so we should be okay with just the fix I have now!

@hjiangsu hjiangsu merged commit f6ff5e8 into develop Nov 26, 2024
1 check passed
@hjiangsu hjiangsu deleted the fix/create-post-page-snackbar branch November 26, 2024 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants