diff --git a/lib/widgets/compose_box.dart b/lib/widgets/compose_box.dart index 1b00654b8f..6e83356042 100644 --- a/lib/widgets/compose_box.dart +++ b/lib/widgets/compose_box.dart @@ -2091,7 +2091,6 @@ class _ComposeBoxState extends State with PerAccountStoreAwareStateM // Fetch-raw-content failed; abort the edit session. // An error dialog was already shown, by fetchRawContentWithFeedback. setState(() { - controller.dispose(); _setNewController(PerAccountStoreWidget.of(context)); }); return; @@ -2119,7 +2118,6 @@ class _ComposeBoxState extends State with PerAccountStoreAwareStateM final store = PerAccountStoreWidget.of(context); setState(() { - controller.dispose(); _setNewController(store); }); } @@ -2144,6 +2142,7 @@ class _ComposeBoxState extends State with PerAccountStoreAwareStateM } void _setNewController(PerAccountStore store) { + _controller?.dispose(); // `?.` because this might be the first call switch (widget.narrow) { case ChannelNarrow(): _controller = StreamComposeBoxController(store: store);