From 9a6e4e2f8022894ee84077950e95ba01ff79b6b0 Mon Sep 17 00:00:00 2001
From: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 16 Sep 2024 23:56:14 +0000
Subject: [PATCH] chore(deps-dev): bump typescript from 5.5.4 to 5.6.2 (#1418)

---
 quartz/components/scripts/clipboard.inline.ts |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/quartz/components/scripts/clipboard.inline.ts b/quartz/components/scripts/clipboard.inline.ts
index c604c9b..87182a1 100644
--- a/quartz/components/scripts/clipboard.inline.ts
+++ b/quartz/components/scripts/clipboard.inline.ts
@@ -14,7 +14,7 @@
       button.type = "button"
       button.innerHTML = svgCopy
       button.ariaLabel = "Copy source"
-      button.addEventListener("click", () => {
+      function onClick() {
         navigator.clipboard.writeText(source).then(
           () => {
             button.blur()
@@ -26,7 +26,9 @@
           },
           (error) => console.error(error),
         )
-      })
+      }
+      button.addEventListener("click", onClick)
+      window.addCleanup(() => button.removeEventListener("click", onClick))
       els[i].prepend(button)
     }
   }

--
Gitblit v1.10.0