Draw only once on next frame callbacks

This commit is contained in:
Antonio Scandurra
2023-10-05 10:57:16 +02:00
parent ed20397a2b
commit bf73b40529
6 changed files with 47 additions and 78 deletions
+1 -3
View File
@@ -77,9 +77,7 @@ impl<S: Send + Sync + 'static> Element for Img<S> {
} else {
cx.spawn(|_, mut cx| async move {
if image_future.await.log_err().is_some() {
cx.on_next_frame(|cx| {
cx.notify();
});
cx.on_next_frame(|cx| cx.notify());
}
})
.detach()