diff --git a/src/components/uploadsGalleryModal/uploadsGalleryModal.tsx b/src/components/uploadsGalleryModal/uploadsGalleryModal.tsx index 8836f63d0..29cdb069c 100644 --- a/src/components/uploadsGalleryModal/uploadsGalleryModal.tsx +++ b/src/components/uploadsGalleryModal/uploadsGalleryModal.tsx @@ -116,7 +116,21 @@ export const UploadsGalleryModal = forwardRef(({username, handleOnSelect, handl } const _onRemovePress = async () => { - _deleteMediaItem(item._id) + const _onConfirm = () => { + _deleteMediaItem(item._id) + } + Alert.alert( + intl.formatMessage({id:'alert.delete'}), + intl.formatMessage({id:'alert.remove_alert'}), + [{ + text:intl.formatMessage({id:'alert.cancel'}), + style:'cancel' + },{ + text:intl.formatMessage({id:'alert.confirm'}), + onPress:_onConfirm + }] + ) + } const thumbUrl = proxifyImageSrc(item.url, 600, 500, Platform.OS === 'ios' ? 'match' : 'webp'); diff --git a/src/config/locales/en-US.json b/src/config/locales/en-US.json index 93dc61248..6cdfd795c 100644 --- a/src/config/locales/en-US.json +++ b/src/config/locales/en-US.json @@ -336,8 +336,7 @@ "title":"Uploaded Images", "title_remove_confirmation":"Delete image", "btn_add":"Image", - "message_failed":"Failed to upload image", - "message_remove_confirmation":"Are you sure you want to delete this image?" + "message_failed":"Failed to upload image" }, "pincode": { "enter_text": "Enter PIN to unlock", diff --git a/src/screens/application/container/applicationContainer.js b/src/screens/application/container/applicationContainer.js index 1d5a27c37..67c4fb3f2 100644 --- a/src/screens/application/container/applicationContainer.js +++ b/src/screens/application/container/applicationContainer.js @@ -621,7 +621,10 @@ class ApplicationContainer extends Component { _getSettings = async () => { const { dispatch } = this.props; + //reset certain properties dispatch(hideActionModal()); + dispatch(toastNotification('')); + const settings = await getSettings(); if (settings) { diff --git a/src/screens/editor/container/editorContainer.js b/src/screens/editor/container/editorContainer.js index 4e22e7f4d..c5cc018f0 100644 --- a/src/screens/editor/container/editorContainer.js +++ b/src/screens/editor/container/editorContainer.js @@ -594,6 +594,11 @@ class EditorContainer extends Component { _saveCurrentDraft = async (fields) => { const { draftId, isReply, isEdit, isPostSending } = this.state; + //skip draft save in case post is sending or is post beign edited + if (isPostSending || isEdit) { + return; + } + const { currentAccount } = this.props; const username = currentAccount && currentAccount.name ? currentAccount.name : ''; @@ -602,20 +607,18 @@ class EditorContainer extends Component { tags: fields.tags && fields.tags.length > 0 ? fields.tags.toString() : '', }; - if (!isPostSending) { - //save reply data - if (isReply && draftField.body !== null) { - await AsyncStorage.setItem('temp-reply', draftField.body); + //save reply data + if (isReply && draftField.body !== null) { + await AsyncStorage.setItem('temp-reply', draftField.body); - //save existing draft data locally - } else if (draftId) { - setDraftPost(draftField, username, draftId); - } + //save existing draft data locally + } else if (draftId) { + setDraftPost(draftField, username, draftId); + } - //update editor data locally - else if (!isReply) { - setDraftPost(draftField, username); - } + //update editor data locally + else if (!isReply) { + setDraftPost(draftField, username); } }; diff --git a/src/screens/editor/screen/editorScreen.js b/src/screens/editor/screen/editorScreen.js index d47f29792..e173ba9f4 100644 --- a/src/screens/editor/screen/editorScreen.js +++ b/src/screens/editor/screen/editorScreen.js @@ -66,8 +66,8 @@ class EditorScreen extends Component { } componentWillUnmount() { - const { isReply } = this.props; - if (!isReply) { + const { isReply, isEdit } = this.props; + if (!isReply && !isEdit) { this._saveDraftToDB(); } }