From ce6861c21765eaf94fecbb9cd849632f2bd77dac Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Tue, 15 Oct 2024 13:21:59 +0800 Subject: [PATCH] fix page flickers --- src/libs/Navigation/OnyxTabNavigator.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libs/Navigation/OnyxTabNavigator.tsx b/src/libs/Navigation/OnyxTabNavigator.tsx index a6a77403f148..0e7dfd4a0a0b 100644 --- a/src/libs/Navigation/OnyxTabNavigator.tsx +++ b/src/libs/Navigation/OnyxTabNavigator.tsx @@ -123,8 +123,12 @@ function OnyxTabNavigator({ const state = event.data.state; const index = state.index; const routeNames = state.routeNames; - Tab.setSelectedTab(id, routeNames.at(index) as SelectedTabRequest); - onTabSelected(routeNames.at(index) as IOURequestType); + const newSelectedTab = routeNames.at(index); + if (selectedTab === newSelectedTab) { + return; + } + Tab.setSelectedTab(id, newSelectedTab as SelectedTabRequest); + onTabSelected(newSelectedTab as IOURequestType); }, ...(screenListeners ?? {}), }}