Skip to content

Commit

Permalink
@uppy/audio: move internal property to private field (#5207)
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Jun 3, 2024
1 parent c39ad85 commit 5afb2af
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/@uppy/audio/src/Audio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default class Audio<M extends Meta, B extends Body> extends UIPlugin<
> {
static VERSION = packageJson.version

private recordingLengthTimer: ReturnType<typeof setInterval>
#recordingLengthTimer: ReturnType<typeof setInterval>

private icon

Expand Down Expand Up @@ -201,8 +201,7 @@ export default class Audio<M extends Meta, B extends Body> extends UIPlugin<
this.#recorder.start(500)

// Start the recordingLengthTimer if we are showing the recording length.
// TODO: switch this to a private field
this.recordingLengthTimer = setInterval(() => {
this.#recordingLengthTimer = setInterval(() => {
const currentRecordingLength = this.getPluginState()
.recordingLengthSeconds as number
this.setPluginState({
Expand All @@ -222,7 +221,7 @@ export default class Audio<M extends Meta, B extends Body> extends UIPlugin<
})
this.#recorder!.stop()

clearInterval(this.recordingLengthTimer)
clearInterval(this.#recordingLengthTimer)
this.setPluginState({ recordingLengthSeconds: 0 })
})

Expand Down Expand Up @@ -289,7 +288,7 @@ export default class Audio<M extends Meta, B extends Body> extends UIPlugin<
this.#recorder!.addEventListener('stop', resolve, { once: true })
this.#recorder!.stop()

clearInterval(this.recordingLengthTimer)
clearInterval(this.#recordingLengthTimer)
})
}

Expand Down

0 comments on commit 5afb2af

Please sign in to comment.