Call Runtime::enter properly in iced_web
This commit is contained in:
parent
c4c5216e3b
commit
148a4dd469
1 changed files with 8 additions and 3 deletions
|
|
@ -188,7 +188,7 @@ pub trait Application {
|
||||||
sender.clone(),
|
sender.clone(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let (app, command) = Self::new(flags);
|
let (app, command) = runtime.enter(|| Self::new(flags));
|
||||||
|
|
||||||
let mut title = app.title();
|
let mut title = app.title();
|
||||||
document.set_title(&title);
|
document.set_title(&title);
|
||||||
|
|
@ -205,8 +205,13 @@ pub trait Application {
|
||||||
let vdom = dodrio::Vdom::new(&body, instance);
|
let vdom = dodrio::Vdom::new(&body, instance);
|
||||||
|
|
||||||
let event_loop = receiver.for_each(move |message| {
|
let event_loop = receiver.for_each(move |message| {
|
||||||
let command = application.borrow_mut().update(message);
|
let (command, subscription) = runtime.enter(|| {
|
||||||
let subscription = application.borrow().subscription();
|
let command = application.borrow_mut().update(message);
|
||||||
|
let subscription = application.borrow().subscription();
|
||||||
|
|
||||||
|
(command, subscription)
|
||||||
|
});
|
||||||
|
|
||||||
let new_title = application.borrow().title();
|
let new_title = application.borrow().title();
|
||||||
|
|
||||||
runtime.spawn(command);
|
runtime.spawn(command);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue