@product7/feedback-sdk 1.3.5 → 1.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@product7/feedback-sdk",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "description": "JavaScript SDK for integrating Product7 feedback widgets into any website",
5
5
  "main": "dist/feedback-sdk.js",
6
6
  "module": "src/index.js",
@@ -204,18 +204,21 @@ async _handleIdentifyContact(contactData) {
204
204
  if (response.status) {
205
205
  console.log('[MessengerWidget] Contact identified:', response.data.contact_id);
206
206
 
207
- // Update state
208
207
  if (!this.messengerState.userContext) {
209
208
  this.messengerState.userContext = {};
210
209
  }
211
210
  this.messengerState.userContext.name = contactData.name;
212
211
  this.messengerState.userContext.email = contactData.email;
213
- this.messengerState.isIdentified = true; // ADD THIS LINE
212
+ this.messengerState.isIdentified = true;
214
213
 
215
- // Process pending message
216
214
  const pendingMessage = this.messengerState.pendingMessage;
217
215
  if (pendingMessage) {
218
216
  this.messengerState.pendingMessage = null;
217
+
218
+ // SET VIEW FIRST
219
+ this.messengerState.setView('chat');
220
+
221
+ // THEN start conversation
219
222
  await this.startNewConversation(
220
223
  pendingMessage.content,
221
224
  '',
@@ -232,7 +235,6 @@ async _handleIdentifyContact(contactData) {
232
235
  throw error;
233
236
  }
234
237
  }
235
-
236
238
  async _handleUploadFile(base64Data, filename) {
237
239
  try {
238
240
  const response = await this.apiService.uploadFile(base64Data, filename);