gpui: Replace redundant code in animation (#19273)

Just a small change to replace some redundant code in the animation
element.

Release Notes:

- N/A
This commit is contained in:
Matin Aniss
2024-10-16 10:26:26 -07:00
committed by GitHub
parent 7a5003bea2
commit 879a2ea06f
+1 -8
View File
@@ -133,14 +133,7 @@ impl<E: IntoElement + 'static> Element for AnimationElement<E> {
let mut element = (self.animator)(element, delta).into_any_element();
if !done {
let parent_id = cx.parent_view_id();
cx.on_next_frame(move |cx| {
if let Some(parent_id) = parent_id {
cx.notify(parent_id)
} else {
cx.refresh()
}
})
cx.request_animation_frame();
}
((element.request_layout(cx), element), state)