Skip to content

Commit

Permalink
Fix double declaration of powered-by-smile-id error
Browse files Browse the repository at this point in the history
  • Loading branch information
ayinloya committed Aug 28, 2024
1 parent 9eb404b commit 0fe9928
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/embed/src/biometric-kyc.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ <h1 style="--flow-space: 4rem">Setting up</h1>
We are setting up your verification flow
</p>

<p class="center credits">
<p class="center credits" hidden>
<span class="visually-hidden">Powered by SmileID</span>
<svg
aria-hidden="true"
Expand Down
7 changes: 6 additions & 1 deletion packages/smart-camera-web/smart-camera-web.js
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,12 @@ function hasMoreThanNColors(data, n = 16) {
return false;
}

window.customElements.define('powered-by-smile-id', PoweredBySmileId);
if (
window.customElements &&
!window.customElements.get('powered-by-smile-id')
) {
window.customElements.define('powered-by-smile-id', PoweredBySmileId);
}

class SmartCameraWeb extends HTMLElement {
constructor() {
Expand Down
8 changes: 6 additions & 2 deletions packages/smart-camera-web/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import PoweredBySmileId from './PoweredBySmileId';
import SmartCameraWeb from './SmartCameraWeb';

window.customElements.define('powered-by-smile-id', PoweredBySmileId);
window.customElements.define('smart-camera-web', SmartCameraWeb);
if (window.customElements && !window.customElements.get('powered-by-smile-id')) {
window.customElements.define('powered-by-smile-id', PoweredBySmileId);
}
if (window.customElements && !window.customElements.get('smart-camera-web')) {
window.customElements.define('smart-camera-web', SmartCameraWeb);
}

0 comments on commit 0fe9928

Please sign in to comment.