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:
commit
29d2236ed2
1 changed files with 5 additions and 4 deletions
|
@ -141,12 +141,13 @@ impl App {
|
||||||
{
|
{
|
||||||
let presenter = presenter.clone();
|
let presenter = presenter.clone();
|
||||||
let path = presenter.borrow().dispatch_path(ctx.as_ref());
|
let path = presenter.borrow().dispatch_path(ctx.as_ref());
|
||||||
if ctx.dispatch_action_any(key_window_id, &path, command, arg.unwrap_or(&())) {
|
ctx.dispatch_action_any(key_window_id, &path, command, arg.unwrap_or(&()));
|
||||||
return;
|
} else {
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ctx.dispatch_global_action_any(command, arg.unwrap_or(&()));
|
ctx.dispatch_global_action_any(command, arg.unwrap_or(&()));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ctx.dispatch_global_action_any(command, arg.unwrap_or(&()));
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
app.0.borrow_mut().weak_self = Some(Rc::downgrade(&app.0));
|
app.0.borrow_mut().weak_self = Some(Rc::downgrade(&app.0));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue