From 5d456899ea444301870e1d3c721d139c9251c531 Mon Sep 17 00:00:00 2001
From: Akshay Nair <phenax5@gmail.com>
Date: Fri, 27 Sep 2024 23:58:15 +0530
Subject: Fix too many updates issue with useFavorites + ui changes

---
 App.tsx | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

(limited to 'App.tsx')

diff --git a/App.tsx b/App.tsx
index c6b5159..2294656 100644
--- a/App.tsx
+++ b/App.tsx
@@ -6,30 +6,32 @@ import {AppList} from './src/screens/AppList';
 import {Home} from './src/screens/Home';
 import {GestureHandlerRootView} from 'react-native-gesture-handler';
 
-function App(): React.JSX.Element {
-  const [apps, setApps] = useState(() => InstalledApps.getSortedApps());
-  const refreshApps = () => setApps(InstalledApps.getSortedApps());
+const App: React.FC = () => {
+  const [apps, _setApps] = useState(() => InstalledApps.getSortedApps());
   const [screenIndex, setScreenIndex] = useState(0);
 
+  // const refreshApps = () => setApps(InstalledApps.getSortedApps());
+
+  // useEffect(() => {
+  //   refreshApps();
+  // }, [screenIndex]);
+
   return (
     <GestureHandlerRootView>
       <SafeAreaView className="flex flex-1 bg-slate-100 dark:bg-black">
         <Swiper
-          autoplay={false}
           horizontal
+          autoplay={false}
           loop={false}
-          loadMinimal
           dot={<></>}
           activeDot={<></>}
-          index={screenIndex}
           onIndexChanged={setScreenIndex}>
           <Home apps={apps} />
-
-          <AppList apps={apps} screenIndex={screenIndex} />
+          <AppList apps={apps} isActive={screenIndex === 1} />
         </Swiper>
       </SafeAreaView>
     </GestureHandlerRootView>
   );
-}
+};
 
 export default App;
-- 
cgit v1.3.1

