drafts: clear post after posting

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-07-01 06:46:02 -07:00
parent a04df88ff6
commit b7366351b6
2 changed files with 7 additions and 0 deletions

View File

@@ -11,6 +11,12 @@ pub struct Drafts {
pub compose: Draft,
}
impl Drafts {
pub fn clear(&mut self, source: DraftSource) {
source.draft(self).buffer = "".to_string();
}
}
pub enum DraftSource<'a> {
Compose,
Reply(&'a [u8; 32]), // note id