From 6fcfaa41f3a5ec6ec7bbd28d98be865b24cfc6ac Mon Sep 17 00:00:00 2001
From: Shravya Ramesh <shravs1208@gmail.com>
Date: Wed, 9 Jun 2021 16:59:40 -0700
Subject: Navigate back on cancel while editing

---
 src/screens/profile/CaptionScreen.tsx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src/screens/profile/CaptionScreen.tsx')

diff --git a/src/screens/profile/CaptionScreen.tsx b/src/screens/profile/CaptionScreen.tsx
index 949b61fd..d4ba6b23 100644
--- a/src/screens/profile/CaptionScreen.tsx
+++ b/src/screens/profile/CaptionScreen.tsx
@@ -169,7 +169,9 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => {
               <Button
                 title="Cancel"
                 buttonStyle={styles.button}
-                onPress={() => navigateToProfile()}
+                onPress={() =>
+                  moment ? navigation.goBack() : navigateToProfile()
+                }
               />
               <Button
                 title={moment ? 'Done' : 'Share'}
-- 
cgit v1.2.3-70-g09d2

