lisichatbot 1.9.6 → 1.9.7

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +10 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisichatbot",
3
- "version": "1.9.6",
3
+ "version": "1.9.7",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "exports": {
package/src/index.js CHANGED
@@ -2818,16 +2818,16 @@ async function showNextStep() {
2818
2818
  console.log(` ✅ Updating current step autoAdvanceDelay:`, result.autoAdvanceDelay);
2819
2819
  currentStep.autoAdvanceDelay = result.autoAdvanceDelay;
2820
2820
  }
2821
-
2822
- // ✅ NEW: Support updating chatState.data from onStart
2823
- if (result.data && typeof result.data === 'object') {
2824
- console.log(` 📝 onStart returned data to update chatState.data:`, result.data);
2825
- // Merge returned data into chatState.data
2826
- Object.keys(result.data).forEach(key => {
2827
- chatState.data[key] = result.data[key];
2828
- console.log(` → chatState.data.${key} = ${JSON.stringify(result.data[key])}`);
2829
- });
2830
- }
2821
+ }
2822
+
2823
+ // NEW: Support updating chatState.data from onStart (moved outside updateCurrentStep block)
2824
+ if (result && typeof result === 'object' && result.data && typeof result.data === 'object') {
2825
+ console.log(` 📝 onStart returned data to update chatState.data:`, result.data);
2826
+ // Merge returned data into chatState.data
2827
+ Object.keys(result.data).forEach(key => {
2828
+ chatState.data[key] = result.data[key];
2829
+ console.log(` → chatState.data.${key} = ${JSON.stringify(result.data[key])}`);
2830
+ });
2831
2831
  }
2832
2832
 
2833
2833
  // ✅ NEW: Check if onStart wants to jump to step by name