Fix TS error: preferred_name can be null from API
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1d21caaa62
commit
10546de751
@ -20,7 +20,7 @@ export default function SettingsPage() {
|
|||||||
const { settings, updateSettings, changePin, isUpdating, isChangingPin } = useSettings();
|
const { settings, updateSettings, changePin, isUpdating, isChangingPin } = useSettings();
|
||||||
const [selectedColor, setSelectedColor] = useState(settings?.accent_color || 'cyan');
|
const [selectedColor, setSelectedColor] = useState(settings?.accent_color || 'cyan');
|
||||||
const [upcomingDays, setUpcomingDays] = useState(settings?.upcoming_days || 7);
|
const [upcomingDays, setUpcomingDays] = useState(settings?.upcoming_days || 7);
|
||||||
const [preferredName, setPreferredName] = useState(settings?.preferred_name || '');
|
const [preferredName, setPreferredName] = useState(settings?.preferred_name ?? '');
|
||||||
const [pinForm, setPinForm] = useState({
|
const [pinForm, setPinForm] = useState({
|
||||||
oldPin: '',
|
oldPin: '',
|
||||||
newPin: '',
|
newPin: '',
|
||||||
|
|||||||
@ -2,7 +2,7 @@ export interface Settings {
|
|||||||
id: number;
|
id: number;
|
||||||
accent_color: string;
|
accent_color: string;
|
||||||
upcoming_days: number;
|
upcoming_days: number;
|
||||||
preferred_name?: string;
|
preferred_name?: string | null;
|
||||||
created_at: string;
|
created_at: string;
|
||||||
updated_at: string;
|
updated_at: string;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user