Skip to content

Commit

Permalink
Fix isLastGameStep
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackRam-oss committed Apr 22, 2024
1 parent 1d7ea63 commit f15dce6
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/managers/StepManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,19 @@ export default class GameStepManager {
*/
static get isLastGameStep(): boolean {
let stepLabel = GameStepManager.currentLabel?.steps
if (stepLabel) {
return GameStepManager.currentLabelStepIndex === stepLabel.length
if (stepLabel && GameStepManager.currentLabelStepIndex === stepLabel.length) {
if (this.openedLabels.length <= 1) {
return true
}
else {
this.openedLabels.forEach((item) => {
let label = getLabelInstanceByClassName(item.label)
if (label && label.steps.length > item.currentStepIndex) {
return false
}
})
return true
}
}
return false
}
Expand Down

0 comments on commit f15dce6

Please sign in to comment.