From 35eb7ba765b5fe4c13c13b4361356943e0b8a508 Mon Sep 17 00:00:00 2001 From: xmflsct Date: Sat, 25 Feb 2023 16:00:08 +0100 Subject: [PATCH] Stop auto refetch when pressing on nav icon Fix #708 --- src/components/Timeline/index.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/Timeline/index.tsx b/src/components/Timeline/index.tsx index 9e9cf4df..3d3a349b 100644 --- a/src/components/Timeline/index.tsx +++ b/src/components/Timeline/index.tsx @@ -233,7 +233,14 @@ const Timeline: React.FC = ({ } }) - useScrollToTop(flRef) + useScrollToTop( + useRef({ + scrollToTop: () => { + shouldAutoFetch.value = false + flRef.current?.scrollToOffset({ animated: true, offset: 0 }) + } + }) + ) useGlobalStorageListener('account.active', () => flRef.current?.scrollToOffset({ offset: 0, animated: false }) )