From ce4f8a26007165c719f26ce1c29fc08cf2af1479 Mon Sep 17 00:00:00 2001 From: enahum Date: Thu, 25 May 2017 09:07:55 -0400 Subject: [PATCH] RN-34 tap to remove ephemeral posts (#563) --- app/components/post/post.js | 4 ++-- yarn.lock | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/post/post.js b/app/components/post/post.js index c9848589d..c4107f10c 100644 --- a/app/components/post/post.js +++ b/app/components/post/post.js @@ -36,7 +36,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, isSystemMessage} from 'mattermost-redux/utils/post_utils'; +import {canDeletePost, canEditPost, isPostEphemeral, isSystemMessage} from 'mattermost-redux/utils/post_utils'; import {isAdmin, isSystemAdmin} from 'mattermost-redux/utils/user_utils'; const BOT_NAME = 'BOT'; @@ -214,7 +214,7 @@ class Post extends PureComponent { const {post, onPress} = this.props; if (onPress && post.state !== Posts.POST_DELETED && !isSystemMessage(post) && !post.failed) { preventDoubleTap(onPress, null, post); - } else if (post.state === Posts.POST_DELETED) { + } else if (isPostEphemeral(post)) { preventDoubleTap(this.onRemovePost, this, post); } }; diff --git a/yarn.lock b/yarn.lock index 63de2378e..f7f629e71 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3526,7 +3526,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/6990daa5f010539075fe3657d379a6cd131b971a" + resolved "https://codeload.github.com/mattermost/mattermost-redux/tar.gz/17b85854e5fda76d4e91b1e28d1e26b4ad57394d" dependencies: deep-equal "1.0.1" harmony-reflect "1.5.1"