fix warning in AsyncWidget's change_to()

This commit is contained in:
rabite 2019-05-22 13:55:13 +02:00
parent ea62d4a36b
commit 0d4e0a3ebf
1 changed files with 6 additions and 2 deletions

View File

@ -88,8 +88,12 @@ impl<W: Widget + Send + 'static> AsyncWidget<W> {
Ok(closure(stale, core.clone())?)
});
widget.on_ready(move |mut w, stale| {
sender.lock().map(|s| s.send(crate::widget::Events::WidgetReady)).ok();
widget.on_ready(move |_, stale| {
if !stale.is_stale()? {
sender.lock()
.map(|s| s.send(crate::widget::Events::WidgetReady))
.ok();
}
Ok(())
}).log();