From 879a2ea06f4144f9850db098c6a1a8a2b4f6afd6 Mon Sep 17 00:00:00 2001 From: Matin Aniss <76515905+MatinAniss@users.noreply.github.com> Date: Thu, 17 Oct 2024 04:26:26 +1100 Subject: [PATCH] gpui: Replace redundant code in animation (#19273) Just a small change to replace some redundant code in the animation element. Release Notes: - N/A --- crates/gpui/src/elements/animation.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/crates/gpui/src/elements/animation.rs b/crates/gpui/src/elements/animation.rs index daa119849655ee803c4e8534fb7976c745092d89..bffa52cfbafb74e5bf00626984752ece170b3690 100644 --- a/crates/gpui/src/elements/animation.rs +++ b/crates/gpui/src/elements/animation.rs @@ -133,14 +133,7 @@ impl Element for AnimationElement { 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)