Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/frontend/components/setting_page/LogSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ const LogSettings = () => {

useEffect(() => {
let isMounted = true;
/**
* Fetches current log settings from the Electron main process and updates component state with the corresponding option values.
*
* Falls back to default values if fetching fails.
*/
async function fetchLogSettings() {
try {
const settings = (await window.electron.ipcRenderer.invoke(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,12 @@ const PronunciationSettings = () => {
const selectedModel = modelOptions.find((opt) => opt.value === modelValue);
const selectedModelSize = selectedModel ? selectedModel.size : "";

// Helper to pick the first defined string value
/**
* Returns the first non-empty string from the provided arguments, or a default failure message if none are found.
*
* @param args - A list of string or undefined values to check
* @returns The first non-empty string, or "Installation failed." if none are provided
*/
function pickFirstString(...args: (string | undefined)[]): string {
for (const arg of args) {
if (typeof arg === "string" && arg.length > 0) return arg;
Expand Down