TTs whisper

This commit is contained in:
2026-06-18 13:45:32 +02:00
parent 0e7fbbfdca
commit 9a23863320
57 changed files with 10430 additions and 253 deletions

View File

@@ -1,15 +1,19 @@
import AsyncStorage from "@react-native-async-storage/async-storage";
import type { Locale } from "./translations";
export const STORAGE_KEYS = {
authToken: "recorder.authToken",
backendUrl: "recorder.backendUrl",
fieldName: "recorder.fieldName",
language: "recorder.language",
};
export type RecorderSettings = {
authToken: string;
backendUrl: string;
fieldName: string;
language: Locale;
};
export async function loadRecorderSettings(): Promise<RecorderSettings> {
@@ -17,6 +21,7 @@ export async function loadRecorderSettings(): Promise<RecorderSettings> {
STORAGE_KEYS.backendUrl,
STORAGE_KEYS.authToken,
STORAGE_KEYS.fieldName,
STORAGE_KEYS.language,
]);
const values = Object.fromEntries(entries);
@@ -25,6 +30,7 @@ export async function loadRecorderSettings(): Promise<RecorderSettings> {
authToken: values[STORAGE_KEYS.authToken] ?? "",
backendUrl: values[STORAGE_KEYS.backendUrl] ?? "",
fieldName: values[STORAGE_KEYS.fieldName] ?? "file",
language: (values[STORAGE_KEYS.language] as Locale) ?? "ca",
};
}
@@ -33,5 +39,6 @@ export async function saveRecorderSettings(settings: RecorderSettings) {
[STORAGE_KEYS.backendUrl, settings.backendUrl],
[STORAGE_KEYS.authToken, settings.authToken],
[STORAGE_KEYS.fieldName, settings.fieldName || "file"],
[STORAGE_KEYS.language, settings.language],
]);
}