@myinterview/chatbot 0.1.23-experimental → 0.1.24-experimental
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/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31284,12 +31284,11 @@ const Fz = gi, P7 = Fz.create({
|
|
|
31284
31284
|
e.messages[t.payload.conversation_sid] = (e.messages[t.payload.conversation_sid] || []).concat(t.payload.messages.reverse());
|
|
31285
31285
|
},
|
|
31286
31286
|
saveMessage(e, t) {
|
|
31287
|
-
console.log("conversation_sid", t.payload.conversation_sid);
|
|
31288
31287
|
const { conversation_sid: r, message: n } = t.payload;
|
|
31289
|
-
if (!n.sid
|
|
31288
|
+
if (!n.sid)
|
|
31290
31289
|
e.messages[r].unshift(n);
|
|
31291
31290
|
else {
|
|
31292
|
-
const i = e.messages[r].findIndex((o) => o.attributes.ts === n.attributes.ts);
|
|
31291
|
+
const i = n.attributes.ts ? e.messages[r].findIndex((o) => o.attributes.ts === n.attributes.ts) : e.messages[r].findIndex((o) => o.sid === n.sid);
|
|
31293
31292
|
i === -1 ? e.messages[r].unshift(n) : e.messages[r][i] = n;
|
|
31294
31293
|
}
|
|
31295
31294
|
},
|