lisichatbot 2.1.1 → 2.1.2

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 +5 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisichatbot",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "exports": {
package/src/index.js CHANGED
@@ -231,10 +231,11 @@ function updateEditIcons() {
231
231
  // ✅ FIX: In edit mode, show edit icons for all completed steps (not just previous)
232
232
  const shouldShowInEditMode = chatState.chatMode === 'edit' && chatState.completed && isLatest;
233
233
  const shouldShowNormally = stepNumber < chatState.step && isLatest;
234
- // ✅ In editSteps mode, show edit icons for steps already visited in the editSteps list
235
- const shouldShowInEditSteps = chatState.editSteps && chatState.editSteps.length > 0 &&
236
- chatState.editSteps.includes(stepNumber) &&
237
- chatState.editSteps.indexOf(stepNumber) < chatState.editStepsIndex && isLatest;
234
+ // ✅ In editSteps mode, show for visited steps (not the current one being shown)
235
+ const isInEditStepsMode = chatState.editSteps && chatState.editSteps.length > 0;
236
+ const editStepPosition = isInEditStepsMode ? chatState.editSteps.indexOf(stepNumber) : -1;
237
+ const shouldShowInEditSteps = isInEditStepsMode && isLatest &&
238
+ editStepPosition !== -1 && editStepPosition < chatState.editStepsIndex;
238
239
 
239
240
  if ((hasInput || forceShowEdit) && (shouldShowInEditMode || shouldShowNormally || shouldShowInEditSteps)) {
240
241
  editIcon.onclick = (e) => {