From d575b536bbf83d8bda4b1dafc270818d1101206c Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Wed, 10 Aug 2022 09:37:59 -0400 Subject: [PATCH] Fix load channels animation (#6558) --- .../channel_list/categories_list/header/loading_unreads.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/screens/home/channel_list/categories_list/header/loading_unreads.tsx b/app/screens/home/channel_list/categories_list/header/loading_unreads.tsx index 162293a29..bdd337885 100644 --- a/app/screens/home/channel_list/categories_list/header/loading_unreads.tsx +++ b/app/screens/home/channel_list/categories_list/header/loading_unreads.tsx @@ -35,7 +35,7 @@ const LoadingUnreads = () => { transform: [{ rotateZ: `${rotation.value}deg`, }], - }), []); + }), [loading]); useEffect(() => { if (loading) { @@ -54,8 +54,10 @@ const LoadingUnreads = () => { useEffect(() => { const listener = DeviceEventEmitter.addListener(Events.FETCHING_POSTS, (value: boolean) => { - cancelAnimation(opacity); setLoading(value); + if (value) { + rotation.value = 0; + } }); return () => listener.remove();