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-17 04:26:26 +11:00 committed by GitHub
parent 7a5003bea2
commit 879a2ea06f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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)