From 42016bfb3807e703844f9a5219939e7d9431fe6e Mon Sep 17 00:00:00 2001
From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com>
Date: Tue, 20 Jul 2021 21:07:32 +0900
Subject: [PATCH] Stop dictation when swapping languages

---
 .../imports/ui/components/captions/pad/component.jsx       | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/bigbluebutton-html5/imports/ui/components/captions/pad/component.jsx b/bigbluebutton-html5/imports/ui/components/captions/pad/component.jsx
index 48576e7efd..36adc13689 100644
--- a/bigbluebutton-html5/imports/ui/components/captions/pad/component.jsx
+++ b/bigbluebutton-html5/imports/ui/components/captions/pad/component.jsx
@@ -104,8 +104,13 @@ class Pad extends PureComponent {
     } = this.props;
 
     if (this.recognition) {
+      if (ownerId !== currentUserId) {
+        this.recognition.stop();
+      } else if (this.state.listening && this.recognition.lang !== locale) {
+        this.recognition.stop();
+        this.stopListen();
+      }
       this.recognition.lang = locale;
-      if (ownerId !== currentUserId) this.recognition.stop();
     }
   }
 
-- 
GitLab