From 73102c50a590b0629f41a850f2061f315af795d4 Mon Sep 17 00:00:00 2001 From: Ramez Date: Thu, 4 Nov 2021 20:19:21 +0200 Subject: [PATCH] feat: cancel upload post button @ error --- components/Home/CreatePost/CreatePost.jsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/components/Home/CreatePost/CreatePost.jsx b/components/Home/CreatePost/CreatePost.jsx index 28283d55..8d809e8f 100644 --- a/components/Home/CreatePost/CreatePost.jsx +++ b/components/Home/CreatePost/CreatePost.jsx @@ -216,9 +216,10 @@ const CreatePost = ({ navigation, route }) => { const isUploadingImages = state.imagesUploadQueue.length !== 0; const isUploadingPost = - isUploadingImages || - createPostMutation.isLoading || - uploadImageMutation.isLoading; + (isUploadingImages || + createPostMutation.isLoading || + uploadImageMutation.isLoading) && + !uploadImageMutation.isError; const imagesProgress = `${ imagesNumber - state.imagesUploadQueue.length @@ -243,6 +244,12 @@ const CreatePost = ({ navigation, route }) => { onPress={() => setCanUpload(true)} /> )} + {!isUploadingPost && ( + setIsProgressModalVisible(false)} + /> + )}