From 761a5c1b0c40301f3205df3c35cc6e3ce231442d Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Tue, 14 May 2024 11:52:02 +0200 Subject: [PATCH] Fix missing stimulus target error --- app/components/chat_message/chat_message.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/components/chat_message/chat_message.js b/app/components/chat_message/chat_message.js index 89bbf35ff..0ead6b871 100644 --- a/app/components/chat_message/chat_message.js +++ b/app/components/chat_message/chat_message.js @@ -56,6 +56,8 @@ export default class extends Controller { } setCopyValue() { + if (!this.hasCopyButtonTarget) return; + const text = this.textTarget.innerText; const sender = this.senderNameValue; @@ -69,6 +71,8 @@ export default class extends Controller { } setCopyUrlValue() { + if (!this.hasCopyButtonTarget) return; + this.copyButtonTarget.dataset.copyButtonCopyValue = this.copyUrlValue; }