mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
Fix interims on Mobile
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import * as React from 'react';
|
||||
|
||||
import { isChromeOnDesktopWindows } from '~/common/util/pwaUtils';
|
||||
import { useUIPreferencesStore } from '~/common/state/store-ui';
|
||||
|
||||
|
||||
@@ -64,7 +65,7 @@ export const useSpeechRecognition = (onResultCallback: (result: SpeechResult) =>
|
||||
|
||||
const instance = new Speech();
|
||||
instance.lang = preferredLanguage;
|
||||
instance.interimResults = true;
|
||||
instance.interimResults = isChromeOnDesktopWindows();
|
||||
instance.maxAlternatives = 1;
|
||||
instance.continuous = true;
|
||||
|
||||
|
||||
@@ -16,4 +16,12 @@ export const isPwa = (): boolean => {
|
||||
if (typeof window !== 'undefined')
|
||||
return window.matchMedia(`(min-width: ${width}px)`).matches;
|
||||
return true;
|
||||
};*/
|
||||
};*/
|
||||
|
||||
export const isChromeOnDesktopWindows = (): boolean => {
|
||||
if (typeof window !== 'undefined') {
|
||||
const agent = window.navigator.userAgent;
|
||||
return agent.indexOf('Windows') > -1 && agent.indexOf('Chrome') > -1 && agent.indexOf('Mobile') === -1;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user