From bac973fb3d933c383cc69612c7ffc45ece837dde Mon Sep 17 00:00:00 2001
From: Akshay Nair <phenax5@gmail.com>
Date: Sun, 29 Sep 2024 13:19:11 +0530
Subject: Switch to jotai atom with storage + suspense for favorites list

---
 src/components/Favorites.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/components/Favorites.tsx')

diff --git a/src/components/Favorites.tsx b/src/components/Favorites.tsx
index ed81a6b..4c8dc37 100644
--- a/src/components/Favorites.tsx
+++ b/src/components/Favorites.tsx
@@ -1,4 +1,4 @@
-import React, {useCallback, useEffect, useMemo} from 'react';
+import React, {useCallback, useMemo} from 'react';
 import {Text, TouchableOpacity, View} from 'react-native';
 import {AppDetail} from 'react-native-launcher-kit/typescript/Interfaces/InstalledApps';
 import {useFavorites} from '../hooks/useFavorites';
@@ -39,7 +39,7 @@ export const Favorites: React.FC<{active: boolean}> = (_) => {
 
   const onDragEnd = useCallback(
     ({data}: DragEndParams<AppDetail>) => {
-      setFavorites(data.map((app) => app.packageName));
+      setFavorites(() => data.map((app) => app.packageName));
     },
     [setFavorites],
   );
-- 
cgit v1.3.1

