@@ -1849,11 +1849,15 @@ class _ComposeBoxState extends State<ComposeBox> with PerAccountStoreAwareStateM
1849
1849
1850
1850
@override
1851
1851
void startEditInteraction (int messageId) async {
1852
- if (await _abortBecauseContentInputNotEmpty ()) return ;
1852
+ final zulipLocalizations = ZulipLocalizations .of (context);
1853
+
1854
+ if (await _abortBecauseContentInputNotEmpty (
1855
+ message: zulipLocalizations.discardDraftConfirmationDialogMessage)) {
1856
+ return ;
1857
+ }
1853
1858
if (! mounted) return ;
1854
1859
1855
1860
final store = PerAccountStoreWidget .of (context);
1856
- final zulipLocalizations = ZulipLocalizations .of (context);
1857
1861
1858
1862
switch (store.getEditMessageErrorStatus (messageId)) {
1859
1863
case null :
@@ -1878,12 +1882,14 @@ class _ComposeBoxState extends State<ComposeBox> with PerAccountStoreAwareStateM
1878
1882
1879
1883
/// If there's text in the compose box, give a confirmation dialog
1880
1884
/// asking if it can be discarded and await the result.
1881
- Future <bool > _abortBecauseContentInputNotEmpty () async {
1885
+ Future <bool > _abortBecauseContentInputNotEmpty ({
1886
+ required String message,
1887
+ }) async {
1882
1888
final zulipLocalizations = ZulipLocalizations .of (context);
1883
1889
if (controller.content.textNormalized.isNotEmpty) {
1884
1890
final dialog = showSuggestedActionDialog (context: context,
1885
1891
title: zulipLocalizations.discardDraftConfirmationDialogTitle,
1886
- message: zulipLocalizations.discardDraftConfirmationDialogMessage ,
1892
+ message: message ,
1887
1893
// TODO(#1032) "destructive" style for action button
1888
1894
actionButtonText: zulipLocalizations.discardDraftConfirmationDialogConfirmButton);
1889
1895
if (await dialog.result != true ) return true ;
0 commit comments