Skip to content

Commit

Permalink
Properly decrement/reset clone count
Browse files Browse the repository at this point in the history
  • Loading branch information
valadaptive committed Jun 2, 2024
1 parent 34065d1 commit e8482f0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export default class Project extends TypedEventTarget<CreateMonitorEvent | Quest
target.destroy();
}
}
this.cloneCount = 0;
this.targets.length = nextOriginalTargetIndex;
// Reset timer when the project is stopped
this.timerStart = this.currentMSecs;
Expand Down Expand Up @@ -219,6 +220,10 @@ export default class Project extends TypedEventTarget<CreateMonitorEvent | Quest
const index = this.targets.indexOf(target);
if (index === -1) return;

if (!target.isOriginal) {
this.cloneCount--;
}

this.targets.splice(index, 1);
target.destroy();
}
Expand Down

0 comments on commit e8482f0

Please sign in to comment.