Преглед на файлове

fix: transcription headers

DDMeaqua преди 1 година
родител
ревизия
318e0989a2
променени са 3 файла, в които са добавени 10 реда и са изтрити 7 реда
  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;
 }
 
-export function getHeaders() {
+export function getHeaders(ignoreHeaders?: boolean) {
   const accessStore = useAccessStore.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();
 

+ 0 - 1
app/components/chat.tsx

@@ -1686,7 +1686,6 @@ function _Chat() {
                                       ? Locale.Chat.Actions.StopSpeech
                                       : Locale.Chat.Actions.Speech
                                   }
-                                  loding={speechLoading}
                                   icon={
                                     speechStatus ? (
                                       <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 { ListItem, Select } from "./ui-lib";
@@ -111,6 +111,7 @@ export function TTSConfigList(props: {
             subTitle={Locale.Settings.TTS.Speed.SubTitle}
           >
             <InputRange
+              aria={Locale.Settings.TTS.Speed.Title}
               value={props.ttsConfig.speed?.toFixed(1)}
               min="0.3"
               max="4.0"