8000 fix error when steps complete but not stage · jordanliu/coderoad-vscode@299769f · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 299769f

Browse files
committed
fix error when steps complete but not stage
1 parent 3ca0266 commit 299769f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/channel/state/Position.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ class Position {
5454
if (lastStepIndex >= steps.length) {
5555
throw new Error('Error setting progress step')
5656
}
57-
const currentStep: G.Step = steps[lastStepIndex]
57+
// handle position when last step is complete but "continue" not yet selected
58+
const adjustedLastStepIndex = lastStepIndex === -1 ? steps.length - 1 : lastStepIndex
59+
const currentStep: G.Step = steps[adjustedLastStepIndex]
5860

5961
this.value = {
6062
levelId: currentLevel.id,

0 commit comments

Comments
 (0)
0