From bd01af416055cffed8a36bf2cba0073c9cb289f3 Mon Sep 17 00:00:00 2001 From: Vika Date: Tue, 20 Aug 2024 22:09:03 +0300 Subject: Don't submit empty posts --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index ce90fec..015f230 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -371,6 +371,10 @@ impl AsyncComponent for PostComposerModel { self.summary_buffer.insert_text(self.summary_buffer.length(), text); }, PostComposerInput::Submit => { + if self.content_buffer.char_count() == 0 { + self.update_view(widgets, sender); + return + } self.set_submit_busy_guard( Some(relm4::main_adw_application().mark_busy()) ); -- cgit 1.4.1