Always prevent window from closing and manually invoke Workspace::close
This ensures we ask the user to save their state if there are unsaved changes.
This commit is contained in:
@@ -907,7 +907,11 @@ impl Workspace {
|
||||
}
|
||||
}
|
||||
|
||||
fn close(&mut self, _: &CloseWindow, cx: &mut ViewContext<Self>) -> Option<Task<Result<()>>> {
|
||||
pub fn close(
|
||||
&mut self,
|
||||
_: &CloseWindow,
|
||||
cx: &mut ViewContext<Self>,
|
||||
) -> Option<Task<Result<()>>> {
|
||||
let prepare = self.prepare_to_close(cx);
|
||||
Some(cx.spawn(|this, mut cx| async move {
|
||||
if prepare.await? {
|
||||
|
||||
Reference in New Issue
Block a user