@gamelearn/arcade-components 1.4.14 → 1.4.15
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/components/conversational-pro-component/components/ConversationalProComponent.js
CHANGED
|
@@ -251,14 +251,19 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
251
251
|
var currentEdge = optionsEdges.find(function (edge) {
|
|
252
252
|
return parseInt(edge.fromPointIndex) === currentId;
|
|
253
253
|
});
|
|
254
|
-
var destinationEdge = lines.findIndex(function (l) {
|
|
255
|
-
return l.id === currentEdge.toId;
|
|
256
|
-
});
|
|
257
254
|
|
|
258
|
-
if (currentEdge
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
255
|
+
if (currentEdge) {
|
|
256
|
+
var destinationEdge = lines.findIndex(function (l) {
|
|
257
|
+
return l.id === currentEdge.toId;
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
if (currentEdge.fromId === currentEdge.toId) {
|
|
261
|
+
reset();
|
|
262
|
+
} else if (destinationEdge >= 0) {
|
|
263
|
+
setCurrentLine(destinationEdge);
|
|
264
|
+
} else {
|
|
265
|
+
finishConversation();
|
|
266
|
+
}
|
|
262
267
|
} else {
|
|
263
268
|
finishConversation();
|
|
264
269
|
}
|
|
@@ -330,11 +330,15 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
330
330
|
return l.id === currentEdge.toId;
|
|
331
331
|
});
|
|
332
332
|
|
|
333
|
-
if (
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
333
|
+
if (destinationEdge) {
|
|
334
|
+
if (currentEdge.fromId === currentEdge.toId) {
|
|
335
|
+
reset();
|
|
336
|
+
} else if (destinationEdge >= 0) {
|
|
337
|
+
setCurrentMessage({});
|
|
338
|
+
changeLine(destinationEdge);
|
|
339
|
+
} else {
|
|
340
|
+
finishConversation();
|
|
341
|
+
}
|
|
338
342
|
} else {
|
|
339
343
|
finishConversation();
|
|
340
344
|
}
|