From 1e54125f7f046742e08b7ea24ce7c546b5e5f83c Mon Sep 17 00:00:00 2001
From: Ansh Nanda <anshnanda10@gmail.com>
Date: Tue, 16 May 2023 16:27:38 -0700
Subject: reload AlgoItem on focus via prop

---
 src/view/com/algos/AlgoItem.tsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'src/view/com/algos/AlgoItem.tsx')

diff --git a/src/view/com/algos/AlgoItem.tsx b/src/view/com/algos/AlgoItem.tsx
index b52a7e00d..ffb8791a8 100644
--- a/src/view/com/algos/AlgoItem.tsx
+++ b/src/view/com/algos/AlgoItem.tsx
@@ -24,11 +24,13 @@ const AlgoItem = observer(
     style,
     showBottom = true,
     onLongPress,
+    reloadOnFocus = false,
   }: {
     item: AlgoItemModel
     style?: StyleProp<ViewStyle>
     showBottom?: boolean
     onLongPress?: () => void
+    reloadOnFocus?: boolean
   }) => {
     const store = useStores()
     const pal = usePalette('default')
@@ -36,7 +38,9 @@ const AlgoItem = observer(
 
     // TODO: this is pretty hacky, but it works for now
     useFocusEffect(() => {
-      item.reload()
+      if (reloadOnFocus) {
+        item.reload()
+      }
     })
 
     return (
-- 
cgit 1.4.1

