drafts: clear post after posting
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -11,6 +11,12 @@ pub struct Drafts {
|
|||||||
pub compose: Draft,
|
pub compose: Draft,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Drafts {
|
||||||
|
pub fn clear(&mut self, source: DraftSource) {
|
||||||
|
source.draft(self).buffer = "".to_string();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub enum DraftSource<'a> {
|
pub enum DraftSource<'a> {
|
||||||
Compose,
|
Compose,
|
||||||
Reply(&'a [u8; 32]), // note id
|
Reply(&'a [u8; 32]), // note id
|
||||||
|
|||||||
@@ -296,6 +296,7 @@ pub fn timeline_view(ui: &mut egui::Ui, app: &mut Damus, timeline: usize) {
|
|||||||
let raw_msg = format!("[\"EVENT\",{}]", note.json().unwrap());
|
let raw_msg = format!("[\"EVENT\",{}]", note.json().unwrap());
|
||||||
info!("sending {}", raw_msg);
|
info!("sending {}", raw_msg);
|
||||||
app.pool.send(&enostr::ClientMessage::raw(raw_msg));
|
app.pool.send(&enostr::ClientMessage::raw(raw_msg));
|
||||||
|
app.drafts.clear(DraftSource::Compose);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user