From 41ad5a4d36f642160e3f633022f5a8938473c655 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 31 May 2024 14:52:26 +0200 Subject: [PATCH] @uppy/audio: move internal property to private field --- packages/@uppy/audio/src/Audio.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/@uppy/audio/src/Audio.tsx b/packages/@uppy/audio/src/Audio.tsx index 7860812ee2..e420c438cd 100644 --- a/packages/@uppy/audio/src/Audio.tsx +++ b/packages/@uppy/audio/src/Audio.tsx @@ -43,7 +43,7 @@ export default class Audio extends UIPlugin< > { static VERSION = packageJson.version - private recordingLengthTimer: ReturnType + #recordingLengthTimer: ReturnType private icon @@ -201,8 +201,7 @@ export default class Audio 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({ @@ -222,7 +221,7 @@ export default class Audio extends UIPlugin< }) this.#recorder!.stop() - clearInterval(this.recordingLengthTimer) + clearInterval(this.#recordingLengthTimer) this.setPluginState({ recordingLengthSeconds: 0 }) }) @@ -289,7 +288,7 @@ export default class Audio extends UIPlugin< this.#recorder!.addEventListener('stop', resolve, { once: true }) this.#recorder!.stop() - clearInterval(this.recordingLengthTimer) + clearInterval(this.#recordingLengthTimer) }) }