Merge pull request #19 from zed-industries/single-global-action-dispatch

Dispatch global actions only once when triggering a menu item
This commit is contained in:
Antonio Scandurra 2021-04-14 15:50:07 +02:00 committed by GitHub
commit 29d2236ed2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -141,12 +141,13 @@ impl App {
{
let presenter = presenter.clone();
let path = presenter.borrow().dispatch_path(ctx.as_ref());
if ctx.dispatch_action_any(key_window_id, &path, command, arg.unwrap_or(&())) {
return;
}
ctx.dispatch_action_any(key_window_id, &path, command, arg.unwrap_or(&()));
} else {
ctx.dispatch_global_action_any(command, arg.unwrap_or(&()));
}
} else {
ctx.dispatch_global_action_any(command, arg.unwrap_or(&()));
}
ctx.dispatch_global_action_any(command, arg.unwrap_or(&()));
}));
app.0.borrow_mut().weak_self = Some(Rc::downgrade(&app.0));