(resuming)
| 516 | } |
| 517 | |
| 518 | #render (resuming) { |
| 519 | if (!this.#rendering) { |
| 520 | return |
| 521 | } |
| 522 | // We always attempt to render immediately but we only request to move to the next frame if it has been longer than our spinner frame duration since our last update |
| 523 | this.#renderFrame(Date.now() - this.#lastUpdate >= this.#spinner.duration, resuming) |
| 524 | if (!this.#interval) { |
| 525 | this.#interval = setInterval(() => this.#renderFrame(true), this.#spinner.duration) |
| 526 | // Make sure this timeout does not keep the process open |
| 527 | this.#interval.unref() |
| 528 | } |
| 529 | this.#interval.refresh() |
| 530 | } |
| 531 | |
| 532 | #renderFrame (next, resuming) { |
| 533 | if (next) { |
no test coverage detected