Private
Public Access
1
0

fix: resolve settings save failure - boolean type mismatch and improve error messages
All checks were successful
CI Pipeline / Rust Format Check (push) Successful in 4s
CI Pipeline / Clippy Lints (push) Successful in 57s
CI Pipeline / Rust Unit Tests (push) Successful in 1m19s
CI Pipeline / Security Audit (push) Successful in 4s
CI Pipeline / Frontend Lint & Type Check (push) Successful in 15s
CI Pipeline / Build .deb & Release (push) Has been skipped

This commit is contained in:
2026-05-13 00:07:46 +00:00
parent c8b1feee19
commit c8b6b01dbc
2 changed files with 56 additions and 56 deletions

View File

@ -5,6 +5,7 @@ import {
IconButton, InputLabel, MenuItem, Select, Snackbar, Switch, TextField,
Toolbar, Typography,
} from '@mui/material'
import type { AxiosError } from 'axios'
import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
import SaveIcon from '@mui/icons-material/Save'
import DeleteIcon from '@mui/icons-material/Delete'
@ -78,8 +79,12 @@ export default function SettingsPage() {
notification,
})
setSuccess('Settings saved successfully')
} catch {
setError('Failed to save settings')
} catch (err: unknown) {
const axiosErr = err as AxiosError<{ error?: { message?: string } }>
const msg =
axiosErr.response?.data?.error?.message ??
(err instanceof Error ? err.message : 'Failed to save settings')
setError(msg)
} finally {
setSaving(false)
}