Skip to content

Commit 9be147a

Browse files
committed
fix: Avoid registering the view-cube twice to address error messges generated by HMR.
1 parent 5b9f7d3 commit 9be147a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ui/view-cube.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class ZeaViewCube extends HTMLElement {
1515
faceHighlightColor = new Color(1, 0.9, 0.5)
1616
constructor() {
1717
super()
18-
1918
this.attachShadow({ mode: 'open' })
2019
}
2120

@@ -224,4 +223,6 @@ class ZeaViewCube extends HTMLElement {
224223
}
225224
}
226225

227-
customElements.define('zea-view-cube', ZeaViewCube)
226+
if (!customElements.get('zea-view-cube')) {
227+
customElements.define('zea-view-cube', ZeaViewCube)
228+
}

0 commit comments

Comments
 (0)