mattermost-mobile/app/utils/tap.js
2017-04-10 11:33:35 -03:00

14 lines
382 B
JavaScript

// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
let canPress = true;
export function preventDoubleTap(action, thisArg, ...args) {
if (canPress) {
canPress = false;
Reflect.apply(action, thisArg || null, [...args]);
setTimeout(() => {
canPress = true;
}, 300);
}
}