Fix panic in open urls (#9032)
Co-Authored-By: Nathan <nathan@zed.dev> Release Notes: - N/A Co-authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
parent
9068911eb4
commit
284a57d4d1
9 changed files with 176 additions and 225 deletions
|
@ -150,14 +150,9 @@ impl App {
|
|||
/// to open one or more URLs.
|
||||
pub fn on_open_urls<F>(&self, mut callback: F) -> &Self
|
||||
where
|
||||
F: 'static + FnMut(Vec<String>, &mut AppContext),
|
||||
F: 'static + FnMut(Vec<String>),
|
||||
{
|
||||
let this = Rc::downgrade(&self.0);
|
||||
self.0.borrow().platform.on_open_urls(Box::new(move |urls| {
|
||||
if let Some(app) = this.upgrade() {
|
||||
callback(urls, &mut app.borrow_mut());
|
||||
}
|
||||
}));
|
||||
self.0.borrow().platform.on_open_urls(Box::new(callback));
|
||||
self
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue