Explorar o código

fix: transcription headers

DDMeaqua hai 1 ano
pai
achega
318e0989a2
Modificáronse 3 ficheiros con 10 adicións e 7 borrados
  1. 8 5
      app/client/api.ts
  2. 0 1
      app/components/chat.tsx
  3. 2 1
      app/components/tts-config.tsx

+ 8 - 5
app/client/api.ts

@@ -220,13 +220,16 @@ export function validString(x: string): boolean {
   return x?.length > 0;
   return x?.length > 0;
 }
 }
 
 
-export function getHeaders() {
+export function getHeaders(ignoreHeaders?: boolean) {
   const accessStore = useAccessStore.getState();
   const accessStore = useAccessStore.getState();
   const chatStore = useChatStore.getState();
   const chatStore = useChatStore.getState();
-  const headers: Record<string, string> = {
-    "Content-Type": "application/json",
-    Accept: "application/json",
-  };
+  let headers: Record<string, string> = {};
+  if (!ignoreHeaders) {
+    headers = {
+      "Content-Type": "application/json",
+      Accept: "application/json",
+    };
+  }
 
 
   const clientConfig = getClientConfig();
   const clientConfig = getClientConfig();
 
 

+ 0 - 1
app/components/chat.tsx

@@ -1686,7 +1686,6 @@ function _Chat() {
                                       ? Locale.Chat.Actions.StopSpeech
                                       ? Locale.Chat.Actions.StopSpeech
                                       : Locale.Chat.Actions.Speech
                                       : Locale.Chat.Actions.Speech
                                   }
                                   }
-                                  loding={speechLoading}
                                   icon={
                                   icon={
                                     speechStatus ? (
                                     speechStatus ? (
                                       <SpeakStopIcon />
                                       <SpeakStopIcon />

+ 2 - 1
app/components/tts-config.tsx

@@ -1,4 +1,4 @@
-import { PluginConfig, TTSConfig, TTSConfigValidator } from "../store";
+import { TTSConfig, TTSConfigValidator } from "../store";
 
 
 import Locale from "../locales";
 import Locale from "../locales";
 import { ListItem, Select } from "./ui-lib";
 import { ListItem, Select } from "./ui-lib";
@@ -111,6 +111,7 @@ export function TTSConfigList(props: {
             subTitle={Locale.Settings.TTS.Speed.SubTitle}
             subTitle={Locale.Settings.TTS.Speed.SubTitle}
           >
           >
             <InputRange
             <InputRange
+              aria={Locale.Settings.TTS.Speed.Title}
               value={props.ttsConfig.speed?.toFixed(1)}
               value={props.ttsConfig.speed?.toFixed(1)}
               min="0.3"
               min="0.3"
               max="4.0"
               max="4.0"