* PLT-5840 Prevent double tapping * handle double tapping on channel header * Review feedback
14 lines
374 B
JavaScript
14 lines
374 B
JavaScript
// Copyright (c) 2017 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);
|
|
}
|
|
}
|