diff --git a/app/actions/views/file_upload.js b/app/actions/views/file_upload.js index efface9cf..a55af0c72 100644 --- a/app/actions/views/file_upload.js +++ b/app/actions/views/file_upload.js @@ -19,19 +19,22 @@ export function handleUploadFiles(files, rootId) { files.forEach((file) => { const mimeType = lookupMimeType(file.fileName); + const extension = file.fileName.split('.').pop().replace('.', ''); const clientId = generateId(); clientIds.push({ clientId, localPath: file.uri, name: file.fileName, - type: mimeType + type: mimeType, + extension }); const fileData = { uri: file.uri, name: file.fileName, - type: mimeType + type: mimeType, + extension }; formData.append('files', fileData); diff --git a/app/components/post/post.js b/app/components/post/post.js index 25d833efc..a1597e649 100644 --- a/app/components/post/post.js +++ b/app/components/post/post.js @@ -37,7 +37,7 @@ import webhookIcon from 'assets/images/icons/webhook.jpg'; import {Posts} from 'mattermost-redux/constants'; import DelayedAction from 'mattermost-redux/utils/delayed_action'; import EventEmitter from 'mattermost-redux/utils/event_emitter'; -import {canDeletePost, canEditPost, isPostEphemeral, isSystemMessage} from 'mattermost-redux/utils/post_utils'; +import {canDeletePost, canEditPost, isPostEphemeral, isPostPendingOrFailed, isSystemMessage} from 'mattermost-redux/utils/post_utils'; import {isAdmin, isSystemAdmin} from 'mattermost-redux/utils/user_utils'; const BOT_NAME = 'BOT'; @@ -216,7 +216,7 @@ class Post extends PureComponent { handlePress = () => { const {post, onPress, tooltipVisible} = this.props; if (!tooltipVisible) { - if (onPress && post.state !== Posts.POST_DELETED && !isSystemMessage(post) && !post.failed) { + if (onPress && post.state !== Posts.POST_DELETED && !isSystemMessage(post) && !isPostPendingOrFailed(post)) { preventDoubleTap(onPress, null, post); } else if (isPostEphemeral(post)) { preventDoubleTap(this.onRemovePost, this, post); @@ -349,7 +349,7 @@ class Post extends PureComponent { const actions = []; // we should check for the user roles and permissions - if (!post.failed) { + if (!isPostPendingOrFailed(post)) { if (isFlagged) { actions.push({ text: formatMessage({id: 'post_info.mobile.unflag', defaultMessage: 'Unflag'}), @@ -384,7 +384,7 @@ class Post extends PureComponent { } else if (this.props.post.message.length) { message = ( - + - + {profilePicture} - + {displayName} @@ -615,13 +615,13 @@ class Post extends PureComponent { } else { contents = ( - + {profilePicture} {this.renderReplyBar(style)} - + {displayName} @@ -660,7 +660,7 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { backgroundColor: theme.centerChannelBg, flexDirection: 'row' }, - failedPost: { + pendingPost: { opacity: 0.5 }, rightColumn: { diff --git a/yarn.lock b/yarn.lock index bc5d3d39a..d9ef40ed7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3645,7 +3645,7 @@ makeerror@1.0.x: mattermost-redux@mattermost/mattermost-redux#master: version "0.0.1" - resolved "https://codeload.github.com/mattermost/mattermost-redux/tar.gz/a31265e306e862ba75b30c3d396847d21319b524" + resolved "https://codeload.github.com/mattermost/mattermost-redux/tar.gz/fe5182358d2e2f0897b4fd5c80cba96e85061d96" dependencies: deep-equal "1.0.1" harmony-reflect "1.5.1"