quiq-chat
Advanced tools
Comparing version 1.29.0 to 1.30.0
{ | ||
"name": "quiq-chat", | ||
"version": "1.29.0", | ||
"version": "1.30.0", | ||
"description": "Library to help with network requests to create a webchat client for Quiq Messaging", | ||
@@ -5,0 +5,0 @@ "main": "build/quiq-chat.js", |
@@ -169,16 +169,3 @@ // @flow | ||
const conversation = await getConversation(); | ||
// Process initial messages, but do not send callback. We'll send all messages in callback next. | ||
this._processConversationResult(conversation, false); | ||
// Send all messages in initial newMessages callback | ||
if (this.callbacks.onNewMessages && this.messages.length) { | ||
this.callbacks.onNewMessages(this.messages); | ||
} | ||
storage.setQuiqUserIsSubscribed(conversation.isSubscribed); | ||
if (conversation.isSubscribed) { | ||
await this._connectSocket(); | ||
} | ||
await this._getConversationAndConnect(); | ||
} catch (err) { | ||
@@ -304,2 +291,19 @@ log.error(`Could not start QuiqChatClient: ${err.message}`, {exception: err}); | ||
_getConversationAndConnect = async () => { | ||
const conversation = await getConversation(); | ||
// Process initial messages, but do not send callback. We'll send all messages in callback next. | ||
this._processConversationResult(conversation, false); | ||
// Send all messages in initial newMessages callback | ||
if (this.callbacks.onNewMessages && this.messages.length) { | ||
this.callbacks.onNewMessages(this.messages); | ||
} | ||
storage.setQuiqUserIsSubscribed(conversation.isSubscribed); | ||
if (conversation.isSubscribed) { | ||
await this._connectSocket(); | ||
} | ||
}; | ||
_hasUserJoinedConversation = (): boolean => { | ||
@@ -407,8 +411,7 @@ if (!this.events) { | ||
// Disconnect/reconnect websocket | ||
// (Connection establishment handler will refresh messages) | ||
await this._connectSocket(); | ||
this.trackingId = newTrackingId; | ||
await this._getConversationAndConnect(); | ||
} else { | ||
this.trackingId = newTrackingId; | ||
} | ||
this.trackingId = newTrackingId; | ||
}; | ||
@@ -415,0 +418,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1458161
113
7081