From e519e704e9e89be37b90a7f75c4a6e7a61221b9a Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 28 Jun 2021 20:40:11 -0600 Subject: [PATCH] Apply suggestions from code review --- .../views/voice_messages/LiveRecordingClock.tsx | 6 +++--- .../views/voice_messages/LiveRecordingWaveform.tsx | 6 +++--- src/utils/MarkedExecution.ts | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/views/voice_messages/LiveRecordingClock.tsx b/src/components/views/voice_messages/LiveRecordingClock.tsx index 49d5dd66e1..2a20e9bfec 100644 --- a/src/components/views/voice_messages/LiveRecordingClock.tsx +++ b/src/components/views/voice_messages/LiveRecordingClock.tsx @@ -37,13 +37,13 @@ export default class LiveRecordingClock extends React.PureComponent this.updateClock(), () => requestAnimationFrame(() => this.scheduledUpdate.trigger()), - ) + ); constructor(props) { super(props); this.state = { seconds: 0, - } + }; } componentDidMount() { @@ -56,7 +56,7 @@ export default class LiveRecordingClock extends React.PureComponent this.updateWaveform(), () => requestAnimationFrame(() => this.scheduledUpdate.trigger()), - ) + ); constructor(props) { super(props); this.state = { waveform: [], - } + }; } componentDidMount() { diff --git a/src/utils/MarkedExecution.ts b/src/utils/MarkedExecution.ts index 624ab499de..01cc91adce 100644 --- a/src/utils/MarkedExecution.ts +++ b/src/utils/MarkedExecution.ts @@ -22,7 +22,7 @@ limitations under the License. * The function starts unmarked. */ export class MarkedExecution { - private _marked = false; + private marked = false; /** * Creates a MarkedExecution for the provided function. @@ -37,22 +37,22 @@ export class MarkedExecution { * Resets the mark without calling the function. */ public reset() { - this._marked = false; + this.marked = false; } /** * Marks the function to be called upon trigger(). */ public mark() { - if (!this._marked) this.onMarkCallback?.(); - this._marked = true; + if (!this.marked) this.onMarkCallback?.(); + this.marked = true; } /** * If marked, the function will be called, otherwise this does nothing. */ public trigger() { - if (!this._marked) return; + if (!this.marked) return; this.reset(); // reset first just in case the fn() causes a trigger() this.fn(); }