diff --git a/frontend_tests/node_tests/compose.js b/frontend_tests/node_tests/compose.js index 4c87483221..5045d060c0 100644 --- a/frontend_tests/node_tests/compose.js +++ b/frontend_tests/node_tests/compose.js @@ -518,10 +518,7 @@ test_ui("enter_with_preview_open", ({override}) => { compose.enter_with_preview_open(); assert.ok($("#enter_sends").prop("checked")); - assert.equal( - $("#compose-error-msg").html(), - $t_html({defaultMessage: "You have nothing to send!"}), - ); + assert.equal($("#compose-error-msg").html(), "never-been-set"); }); test_ui("finish", ({override}) => { diff --git a/static/js/compose_validate.js b/static/js/compose_validate.js index 948b8f3eae..cc612a3d62 100644 --- a/static/js/compose_validate.js +++ b/static/js/compose_validate.js @@ -522,10 +522,14 @@ export function validate() { } if (/^\s*$/.test(message_content)) { - compose_error.show( - $t_html({defaultMessage: "You have nothing to send!"}), - $("#compose-textarea"), - ); + // Avoid showing an error message when "enter sends" is enabled, + // as it is more likely that the user has hit "Enter" accidentally. + if (!page_params.enter_sends) { + compose_error.show( + $t_html({defaultMessage: "You have nothing to send!"}), + $("#compose-textarea"), + ); + } return false; }