-
✕
-
-
This website uses Puter to bring you safe, secure, and private AI and Cloud features.
-
- `;
+ `;
+ }
+
+
+ this.shadowRoot.innerHTML = h;
// Event listener for the 'message' event
this.messageListener = async (event) => {
@@ -341,7 +388,7 @@ class PuterDialog extends HTMLElement {
connectedCallback() {
// Add event listener to the button
- this.shadowRoot.querySelector('#launch-auth-popup').addEventListener('click', ()=>{
+ this.shadowRoot.querySelector('#launch-auth-popup')?.addEventListener('click', ()=>{
let w = 600;
let h = 400;
let title = 'Puter';
@@ -356,8 +403,8 @@ class PuterDialog extends HTMLElement {
window.addEventListener('message', this.messageListener);
// Add event listeners for cancel and close buttons
- this.shadowRoot.querySelector('#launch-auth-popup-cancel').addEventListener('click', this.cancelListener);
- this.shadowRoot.querySelector('.close-btn').addEventListener('click',this.cancelListener);
+ this.shadowRoot.querySelector('#launch-auth-popup-cancel')?.addEventListener('click', this.cancelListener);
+ this.shadowRoot.querySelector('.close-btn')?.addEventListener('click',this.cancelListener);
}
open() {