From 90bcbebedb4aa1ba8da6cfc28b5799dd965d469b Mon Sep 17 00:00:00 2001 From: Horatiu Muresan Date: Fri, 23 Sep 2022 13:38:51 +0300 Subject: [PATCH] fix(carmode) Don`t show rec/live labels after rec/ls finished --- .../components/AbstractRecordingLabel.js | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/react/features/recording/components/AbstractRecordingLabel.js b/react/features/recording/components/AbstractRecordingLabel.js index d3e1da6a6..f4aeb7d61 100644 --- a/react/features/recording/components/AbstractRecordingLabel.js +++ b/react/features/recording/components/AbstractRecordingLabel.js @@ -84,12 +84,30 @@ export default class AbstractRecordingLabel super(props); this.state = { - staleLabel: false + staleLabel: true }; this._updateStaleStatus({}, props); } + /** + * Implements React {@code Component}'s componentDidMount. + * + * @inheritdoc + */ + componentDidMount() { + this._mounted = true; + } + + /** + * Implements React {@code Component}'s componentWillUnmount. + * + * @inheritdoc + */ + componentWillUnmount() { + this._mounted = false; + } + /** * Implements {@code Component#componentDidUpdate}. * @@ -149,6 +167,10 @@ export default class AbstractRecordingLabel if (newProps._status === JitsiRecordingConstants.status.OFF) { if (oldProps._status !== JitsiRecordingConstants.status.OFF) { setTimeout(() => { + if (!this._mounted) { + return; + } + // Only if it's still OFF. if (this.props._status === JitsiRecordingConstants.status.OFF) {