Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
khanh1902 committed Jul 16, 2024
1 parent 2fe7336 commit c0927f3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions actions/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ class MainDialog extends ComponentDialog {
nextAction: id,
nextActions,
assignUserResponse,
variable
variable,
variableInput
} = step._info.options;
const { checkAction, actionId } = step.result;
const conversationData = await this.conversationDataAccessor.get(
Expand Down Expand Up @@ -245,7 +246,7 @@ class MainDialog extends ComponentDialog {

if (checkAction) {
const Case = this.GetNextAction({
attribute: assignUserResponse || variable || 'answer',
attribute: assignUserResponse || variable || variableInput || 'answer',
actions: nextActions || [],
data: conversationData.variables,
});
Expand Down Expand Up @@ -294,7 +295,7 @@ class MainDialog extends ComponentDialog {
GetNextAction({ attribute, actions, data }) {
if (!Array.isArray(actions)) return;

const checkData = data.find((x) => x.name === attribute).value;
const checkData = data.find((x) => x.name === attribute)?.value || replaceData({ text: attribute, data });;

for (let Case of actions) {
if (!Case) return;
Expand Down

0 comments on commit c0927f3

Please sign in to comment.