Move dispatch_action_any_action_at
to AsyncAppContext
This commit is contained in:
parent
c4472b0786
commit
eb2cce98a7
3 changed files with 37 additions and 49 deletions
|
@ -167,9 +167,11 @@ impl PickerDelegate for CommandPaletteDelegate {
|
|||
let focused_view_id = self.focused_view_id;
|
||||
let action_ix = self.matches[self.selected_ix].candidate_id;
|
||||
let action = self.actions.remove(action_ix).action;
|
||||
cx.defer(move |_, cx| {
|
||||
cx.dispatch_any_action_at(window_id, focused_view_id, action);
|
||||
});
|
||||
cx.app_context()
|
||||
.spawn(move |mut cx| async move {
|
||||
cx.dispatch_action(window_id, focused_view_id, action.as_ref())
|
||||
})
|
||||
.detach_and_log_err(cx);
|
||||
}
|
||||
cx.emit(PickerEvent::Dismiss);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue