Put context parameter last in toggle_modal callback

This is more consistent with our treatment of context params everywhere else.
This commit is contained in:
Nathan Sobo 2022-05-10 16:46:53 -06:00
parent 6b5cab5db1
commit 9c68c3e8a9
8 changed files with 9 additions and 9 deletions

View file

@ -943,7 +943,7 @@ impl Workspace {
) -> Option<ViewHandle<V>>
where
V: 'static + View,
F: FnOnce(&mut ViewContext<Self>, &mut Self) -> ViewHandle<V>,
F: FnOnce(&mut Self, &mut ViewContext<Self>) -> ViewHandle<V>,
{
cx.notify();
// Whatever modal was visible is getting clobbered. If its the same type as V, then return
@ -953,7 +953,7 @@ impl Workspace {
cx.focus_self();
Some(already_open_modal)
} else {
let modal = add_view(cx, self);
let modal = add_view(self, cx);
cx.focus(&modal);
self.modal = Some(modal.into());
None