diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-09-27 13:14:16 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-09-27 13:40:02 +0300 |
commit | d44a68ec6950c533cf67ee2a34f9888a4ae569cc (patch) | |
tree | 53290428c5e295fcc6c0999dcbfd92fc54acfb13 /ui/src/components/mail/compose.rs | |
parent | 713c4f73b991544259301d87fd2c79007e96db8f (diff) |
ui: don't quit if editing a draft
Ask user to save draft or discard it.
Diffstat (limited to 'ui/src/components/mail/compose.rs')
-rw-r--r-- | ui/src/components/mail/compose.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/src/components/mail/compose.rs b/ui/src/components/mail/compose.rs index 0da317d7..3f6da8eb 100644 --- a/ui/src/components/mail/compose.rs +++ b/ui/src/components/mail/compose.rs @@ -756,6 +756,13 @@ impl Component for Composer { fn set_id(&mut self, id: ComponentId) { self.id = id; } + + fn can_quit_cleanly(&mut self) -> bool { + /* Play it safe and ask user for confirmation */ + self.mode = ViewMode::Discard(self.id); + self.set_dirty(); + false + } } pub fn send_draft(context: &mut Context, account_cursor: usize, draft: Draft) -> bool { |