Skip to content

Commit 331e155

Browse files
committed
compose_box: Reorder two calls in edit-message "Save" tap handler
I'm fairly certain this is NFC. The two calls do operate on shared state, in the controller, but it should suffice to just capture `messageId` and `newContent` from the ComposeBoxController before endMessageEdit disposes it. Soon we'd like `store.editMessage` to return a Future, which we'd like to await and add some error feedback, just like we have in the send-message UX.
1 parent 7e98ff1 commit 331e155

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/widgets/compose_box.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,11 +1789,13 @@ class _EditMessageBanner extends _Banner {
17891789
return;
17901790
}
17911791

1792+
final messageId = controller.messageId;
1793+
final newContent = controller.content.textNormalized;
1794+
composeBoxState.endEditInteraction();
17921795
store.editMessage(
1793-
messageId: controller.messageId,
1796+
messageId: messageId,
17941797
originalRawContent: originalRawContent,
1795-
newContent: controller.content.textNormalized);
1796-
composeBoxState.endEditInteraction();
1798+
newContent: newContent);
17971799
}
17981800

17991801
@override

0 commit comments

Comments
 (0)