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: guard setState calls in message_input.dart with mounted checks #1299

Merged
merged 2 commits into from
Aug 3, 2024

Conversation

kevmo314
Copy link
Contributor

@kevmo314 kevmo314 commented Aug 3, 2024

Guard the setState calls in lib/components/message_input.dart with mounted checks.

  • Add a mounted check before the setState call on line 113 to ensure _textEditingController is cleared only if the widget is still mounted.
  • Add a mounted check before the setState call on line 120 to ensure _pendingSend list is updated only if the widget is still mounted.
  • Add a mounted check before the setState call on line 126 to ensure _pendingSend list is updated only if the widget is still mounted.

For more details, open the Copilot Workspace session.

Guard the `setState` calls in `lib/components/message_input.dart` with mounted checks.

* Add a mounted check before the `setState` call on line 113 to ensure `_textEditingController` is cleared only if the widget is still mounted.
* Add a mounted check before the `setState` call on line 120 to ensure `_pendingSend` list is updated only if the widget is still mounted.
* Add a mounted check before the `setState` call on line 126 to ensure `_pendingSend` list is updated only if the widget is still mounted.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/muxable/rtchat?shareId=XXXX-XXXX-XXXX-XXXX).
@kevmo314 kevmo314 merged commit ab78c4a into main Aug 3, 2024
7 checks passed
@kevmo314 kevmo314 deleted the kevmo314/fix-setstate-mounted-checks branch August 3, 2024 12:46
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