Skip to content

Commit

Permalink
Added check to prevent startTrickle from firing multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
lorikku committed Apr 23, 2024
1 parent c242c3a commit a873138
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/HolyProgress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,15 @@ export class HolyProgress {
* @public
* @returns {HolyProgress} The current instance for chaining methods.
*/
public start = (): HolyProgress => {
public readonly start = (): HolyProgress => {
if (this.status === null) {
this.setTo(0);
}

this.startTrickle();
this.startTrickle();

if (this.settings.showSpinner === true) {
this.createSpinner();
if (this.settings.showSpinner === true) {
this.createSpinner();
}
}

return this;
Expand All @@ -219,7 +219,7 @@ export class HolyProgress {
* @public
* @returns {HolyProgress} The current instance for chaining methods.
*/
public complete = (): HolyProgress => this.setTo(1);
public readonly complete = (): HolyProgress => this.setTo(1);

/**
* Calculates an increment value based on the current status of the progress.
Expand Down

0 comments on commit a873138

Please sign in to comment.