rm multiple same listeners

pull/5601/head
STetsing 4 weeks ago committed by Aniket
parent dfe7f40f9c
commit de65e44d3a
  1. 3
      libs/remix-ui/remix-ai/src/lib/components/Default.tsx

@ -36,6 +36,9 @@ export const Default = (props) => {
Array.from(codeBlocks).forEach((block) => {
const copyButtons = block.getElementsByClassName('nlux-comp-copyButton');
Array.from(copyButtons).forEach((cp_btn) => {
// remove click event listener if existing
cp_btn.removeEventListener('click', () => {});
cp_btn.addEventListener('click', async () => {
await navigator.clipboard.writeText(block.textContent);
});

Loading…
Cancel
Save