Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(face-landmarks): not sending duplicate expressions when recognition stops (#12067)

Gabriel Borleab9aeb193796e
diff --git a/react/features/face-landmarks/actions.js b/react/features/face-landmarks/actions.js
index 1263690adf..243f81b0e1 100644
--- a/react/features/face-landmarks/actions.js
+++ b/react/features/face-landmarks/actions.js
@@ -212,8 +212,10 @@ export function startFaceLandmarksDetection(track) {
* @returns {void}
*/
export function stopFaceLandmarksDetection() {
- return function(dispatch: Function) {
- if (lastFaceExpression && lastFaceExpressionTimestamp) {
+ return function(dispatch: Function, getState: Function) {
+ const { recognitionActive } = getState()['features/face-landmarks'];
+
+ if (lastFaceExpression && lastFaceExpressionTimestamp && recognitionActive) {
dispatch(
addFaceExpression(
lastFaceExpression,
@@ -227,6 +229,8 @@ export function stopFaceLandmarksDetection() {
clearInterval(detectionInterval);
duplicateConsecutiveExpressions = 0;
+ lastFaceExpression = null;
+ lastFaceExpressionTimestamp = null;
webhookSendInterval = null;
detectionInterval = null;
imageCapture = null;