talkjs / talkjs-examples

TalkJS (https://talkjs.com) examples
118 stars 119 forks source link

Persist and restore session credentials, instead of incorrectly persi… #542

Closed vaughnd closed 3 months ago

vaughnd commented 3 months ago

…sting the talkSession object

stevenwaterman commented 3 months ago

Thank you for raising this, you're absolutely right that this was a mistake :slightly_smiling_face:

Was the buildSession -> chatBuildSession change a mistake? I can't see chatBuildSession being defined anywhere but don't want to revert that change and merge, without checking with you first.

vaughnd commented 3 months ago

Ahh sorry, yes, I renamed functions to chat* to avoid conflicts. I also ended up with a single chat.js to simplify things, as I ran into troubles with initialiseSession happening concurrently and causing issues with duplicate popups, etc. chatLoadInbox only kicks off if the element is on the page.

$(async function() {
    await chatInitializeSession()
    chatInitializeUnreadMessages()
    chatInitPrivateMessaging();
    chatLoadInbox();
})
stevenwaterman commented 3 months ago

Fixed in https://github.com/talkjs/talkjs-examples/commit/c2f7bb2295b08006a46cb1e67662311a52cafd61, thank you for raising this :)