From 23ea5929870c180a688433faabcbeafd2353db11 Mon Sep 17 00:00:00 2001
From: João Ferreiro <ferreiro@pinkroom.dev>
Date: Tue, 29 Nov 2022 16:00:21 +0000
Subject: move show carousel out of the component

---
 src/view/com/composer/ComposePost.tsx | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

(limited to 'src/view/com/composer/ComposePost.tsx')

diff --git a/src/view/com/composer/ComposePost.tsx b/src/view/com/composer/ComposePost.tsx
index 114586f47..9fe6b78b3 100644
--- a/src/view/com/composer/ComposePost.tsx
+++ b/src/view/com/composer/ComposePost.tsx
@@ -232,12 +232,15 @@ export const ComposePost = observer(function ComposePost({
           selectedPhotos={selectedPhotos}
           setSelectedPhotos={setSelectedPhotos}
         />
-        <PhotoCarouselPicker
-          selectedPhotos={selectedPhotos}
-          setSelectedPhotos={setSelectedPhotos}
-          localPhotos={localPhotos}
-          inputText={text}
-        />
+        {localPhotos.photos != null &&
+          text === '' &&
+          selectedPhotos.length === 0 && (
+            <PhotoCarouselPicker
+              selectedPhotos={selectedPhotos}
+              setSelectedPhotos={setSelectedPhotos}
+              localPhotos={localPhotos}
+            />
+          )}
         <View style={styles.separator} />
         <View style={[s.flexRow, s.pt10, s.pb10, s.pr5, styles.contentCenter]}>
           <View style={s.flex1} />
-- 
cgit 1.4.1

