Skip to content

Commit

Permalink
feat: cancel upload post button @ error
Browse files Browse the repository at this point in the history
  • Loading branch information
rameziophobia committed Nov 4, 2021
1 parent e70d4cb commit 73102c5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions components/Home/CreatePost/CreatePost.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -243,6 +244,12 @@ const CreatePost = ({ navigation, route }) => {
onPress={() => setCanUpload(true)}
/>
)}
{!isUploadingPost && (
<TransparentButton
text="Cancel"
onPress={() => setIsProgressModalVisible(false)}
/>
)}
</Modal>
</Portal>
<MaterialCreateHeader
Expand Down

0 comments on commit 73102c5

Please sign in to comment.