Skip to content
Snippets Groups Projects
Commit c2bb4f0d authored by Jean-Baptiste Pasquier's avatar Jean-Baptiste Pasquier
Browse files

Merge branch 'bugfix/fix-chat-loading' into 'master'

bugfix: fix chat loading

See merge request components/sib-chat!29
parents 7a545ceb 26b1ceb6
No related branches found
No related tags found
No related merge requests found
......@@ -67,10 +67,9 @@ export const SibChat = {
if(typeof converse_sib !== 'undefined') {
await converse_sib.loaded_deferred;
if (await this.resource.jabberRoom) {
this.jid = (await this.resource['foaf:jabberID']);
this.jid = await this.resource['jabberID'];
} else {
await store.initGraph(this.resource['@id'], this.context);
this.jid = await (store.get(this.resource['@id'])['chatProfile.jabberID']);
this.jid = await this.resource['chatProfile.jabberID'];
}
await converse_sib.connected_deferred
converse_sib.service.plugins.sibChat.changeChat(
......@@ -81,7 +80,7 @@ export const SibChat = {
window.dispatchEvent(new CustomEvent('read', {
detail: {
resource: {
"@id": this.resource
"@id": this.resource['@id']
}
}
}));
......@@ -114,7 +113,7 @@ export const SibChat = {
// Change chat plugin
converse_sib.service.plugins.sibChat = new(class {
changeChat(jid, is_groupchat, root) {
if (!jid) {
if (!jid || (root && root.host.offsetParent === null)) {
return;
}
jid = jid.toLowerCase();
......@@ -167,7 +166,7 @@ export const SibChat = {
const resource = Array.from(document.querySelectorAll('sib-chat'))
.filter(el => {return el.shadowRoot.getElementById('conversejs')})
.pop()
._component.resource;
.component.resource;
window.dispatchEvent(new CustomEvent('read', {
detail: {
resource: resource
......@@ -183,10 +182,9 @@ export const SibChat = {
if(this.resource) {
if (await this.resource.jabberRoom) {
this.jid = (await this.resource['foaf:jabberID']);
this.jid = await this.resource['jabberID'];
} else {
await store.initGraph(this.resource['@id'], this.context);
this.jid = (await (store.get(this.resource['@id'])['chatProfile.jabberID']));
this.jid = await this.resource['chatProfile.jabberID'];
}
} else {
this.jid = jabberID;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment