Move more window methods off AsyncAppContext
This commit is contained in:
parent
95cd96e4be
commit
b2d9ccc0a2
8 changed files with 73 additions and 64 deletions
|
@ -1,5 +1,5 @@
|
|||
use gpui::{
|
||||
anyhow,
|
||||
anyhow::{self, anyhow},
|
||||
elements::*,
|
||||
geometry::vector::Vector2F,
|
||||
keymap_matcher::KeymapContext,
|
||||
|
@ -223,7 +223,9 @@ impl ContextMenu {
|
|||
let action = action.boxed_clone();
|
||||
cx.app_context()
|
||||
.spawn(|mut cx| async move {
|
||||
cx.dispatch_action(window, view_id, action.as_ref())
|
||||
window
|
||||
.dispatch_action(view_id, action.as_ref(), &mut cx)
|
||||
.ok_or_else(|| anyhow!("window was closed"))
|
||||
})
|
||||
.detach_and_log_err(cx);
|
||||
}
|
||||
|
@ -486,7 +488,13 @@ impl ContextMenu {
|
|||
let action = action.boxed_clone();
|
||||
cx.app_context()
|
||||
.spawn(|mut cx| async move {
|
||||
cx.dispatch_action(window, view_id, action.as_ref())
|
||||
window
|
||||
.dispatch_action(
|
||||
view_id,
|
||||
action.as_ref(),
|
||||
&mut cx,
|
||||
)
|
||||
.ok_or_else(|| anyhow!("window was closed"))
|
||||
})
|
||||
.detach_and_log_err(cx);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue