Skip to content

Commit

Permalink
fix: don't define the custom element if already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
marekvospel committed Jul 26, 2023
1 parent 064306e commit 5992b91
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,6 @@ export class AsciinemaPlayer extends HTMLElement {

export function useAsciinemePlayerCe() {
const wind = typeof window !== 'undefined' ? window : undefined
wind?.customElements?.define('asciinema-player', AsciinemaPlayer)
if (!wind?.customElements?.get('asciinema-player'))
wind.customElements.define('asciinema-player', AsciinemaPlayer)
}

0 comments on commit 5992b91

Please sign in to comment.