diff --git a/src/solid-xmpp-chat.js b/src/solid-xmpp-chat.js index 050a0d8b9898272ce9d78d212ec6acf650b70f88..25bd0becb8a1232d25e1d33f587d3d225862130f 100644 --- a/src/solid-xmpp-chat.js +++ b/src/solid-xmpp-chat.js @@ -45,12 +45,10 @@ export const SolidXMPPChat = { async created() { const check_identified = await document.querySelector('sib-auth').getUserIdToken(); if (check_identified) { - this.element.attachShadow({ - mode: 'open', - }); + this.element.attachShadow({ mode: 'open' }); this.importCSS(`${ComponentPath}/dist/conversejs/converse.min.css?min`); this.importCSS(`${ComponentPath}/dist/index.css?min`); - if (window.converse_sib === undefined) { + if (typeof converse_sib === 'undefined') { this.initializeConverse(); } } // Else, not logged in on page load (even if not on chat) @@ -143,22 +141,8 @@ export const SolidXMPPChat = { // Deferred resolved after converse.initialize converse_sib.connected_deferred = new Deferred(); - // Registering window.converse_sib.service - converse_sib.service = { - 'waitUntilLoaded': converse_sib.loaded_deferred.promise, - 'initialize': function(options) { - this.waitUntilLoaded().done(this.api.initialize, options); - }, - 'waitUntilConnected': converse_sib.connected_deferred.promise, - 'plugins': {}, - }; - this.removeConverseDatabase(); - // Alias for solid-xmpp-chat use # want to un-expose converse from window later - // window.converse_sib.service.api === window.converse - converse_sib.service.api = converse; - // Initialize deferred resolution plugin setTimeout(async () => {