Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@uppy/audio: move internal property to private field #5207

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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