diff --git a/app/components/message_attachments/action_button/action_button.js b/app/components/message_attachments/action_button/action_button.js index 52facdfc1..4209dc68a 100644 --- a/app/components/message_attachments/action_button/action_button.js +++ b/app/components/message_attachments/action_button/action_button.js @@ -23,7 +23,7 @@ export default class ActionButton extends PureComponent { handleActionPress = preventDoubleTap(() => { const {actions, id, postId} = this.props; actions.doPostAction(postId, id); - }); + }, 4000); render() { const {name, theme} = this.props; diff --git a/app/utils/tap.js b/app/utils/tap.js index a978b0edc..a8ad69c4d 100644 --- a/app/utils/tap.js +++ b/app/utils/tap.js @@ -1,9 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -const doublePressDelay = 300; - -export function preventDoubleTap(func) { +export function preventDoubleTap(func, doublePressDelay = 300) { let canPressWrapped = true; return (...args) => {