If send is pressed with empty text buffer, don't do anything

This commit is contained in:
Mike Dilger 2022-12-24 19:41:22 +13:00
parent af3f2f8258
commit a9a4688b7e

View File

@ -13,14 +13,15 @@ pub(super) fn update(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Fram
ui.horizontal(|ui| { ui.horizontal(|ui| {
ui.text_edit_multiline(&mut app.draft); ui.text_edit_multiline(&mut app.draft);
if ui.button("Send").clicked() { if ui.button("Send").clicked() && !app.draft.is_empty() {
info!("Would send: {}", app.draft); info!("Would send: {}", app.draft);
app.draft = "".to_owned();
// We need our private key // We need our private key
// Then we need to create a TextNote event // Then we need to create a TextNote event
// Then we need to send it to multiple relays // Then we need to send it to multiple relays
// NOT a one-liner // NOT a one-liner
app.draft = "".to_owned();
} }
}); });