Merge disable post button if draft buffer empty #469

William Casarin (2):
      ui: simply hide post button if buffer is empty

kernelkind (1):
      disable post button if draft buffer empty
This commit is contained in:
William Casarin
2024-11-22 12:50:07 -08:00

View File

@@ -208,8 +208,16 @@ impl<'a> PostView<'a> {
}
ui.with_layout(egui::Layout::right_to_left(egui::Align::BOTTOM), |ui| {
if self.draft.buffer.is_empty() {
// Don't render button if our buffer is empty
return None;
}
if ui
.add_sized([91.0, 32.0], egui::Button::new("Post now"))
.add_sized(
[91.0, 32.0],
egui::Button::new("Post now")
)
.clicked()
{
let new_post = NewPost::new(