Using a leading debounce on send2chat button

This commit is contained in:
Vlyan
2021-08-18 09:50:19 +02:00
parent 46e0a3c05b
commit 2689d48f68
8 changed files with 43 additions and 15 deletions

View File

@@ -26,7 +26,13 @@ export class ItemSheetL5r5e extends ItemSheet {
label: game.i18n.localize("l5r5e.global.send_to_chat"),
class: "send-to-chat",
icon: "fas fa-comment-dots",
onclick: async () => game.l5r5e.HelpersL5r5e.sendToChat(this.object),
onclick: () =>
game.l5r5e.HelpersL5r5e.debounce(
"send2chat-" + this.object.id,
() => game.l5r5e.HelpersL5r5e.sendToChat(this.object),
2000,
true
)(),
});
return buttons;