@contentgrowth/llm-service 0.9.6 → 0.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -175,7 +175,6 @@ var useSpeechRecognition = (onResult, onEnd, language = "en-US") => {
175
175
  const recognition = new SpeechRecognition();
176
176
  recognition.continuous = true;
177
177
  recognition.interimResults = true;
178
- recognition.lang = language;
179
178
  recognition.onstart = () => {
180
179
  setIsListening(true);
181
180
  setError(null);
@@ -236,6 +235,11 @@ var useSpeechRecognition = (onResult, onEnd, language = "en-US") => {
236
235
  recognitionRef.current.stop();
237
236
  }
238
237
  };
238
+ }, []);
239
+ useEffect(() => {
240
+ if (recognitionRef.current) {
241
+ recognitionRef.current.lang = language;
242
+ }
239
243
  }, [language]);
240
244
  const start = useCallback(() => {
241
245
  if (recognitionRef.current && !isListening) {