From ac75858fd276deb62f5bb2b38fa891e75c90cfba Mon Sep 17 00:00:00 2001 From: Matas Date: Sat, 5 Apr 2025 17:48:47 +0300 Subject: [PATCH] fix: check whether the component is defined already (#337) Co-authored-by: Matas Co-authored-by: Katsuyuki Karasawa <4ranci0ne@gmail.com> --- src/components/widget/TOC.astro | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/widget/TOC.astro b/src/components/widget/TOC.astro index eb555788..126809d5 100644 --- a/src/components/widget/TOC.astro +++ b/src/components/widget/TOC.astro @@ -256,6 +256,7 @@ class TableOfContents extends HTMLElement { }; } -customElements.define("table-of-contents", TableOfContents); - +if (!customElements.get("table-of-contents")) { + customElements.define("table-of-contents", TableOfContents); +} \ No newline at end of file