mirror of
https://github.com/khoaliber/LetterFeed.git
synced 2026-03-02 13:18:27 +00:00
fix: #20
This commit is contained in:
@@ -68,7 +68,11 @@ export function SettingsDialog({
|
||||
const handleSave = async () => {
|
||||
if (!currentSettings) return
|
||||
try {
|
||||
await updateSettings(currentSettings)
|
||||
const payload: SettingsCreate = { ...currentSettings }
|
||||
if (payload.imap_password === "") {
|
||||
delete payload.imap_password
|
||||
}
|
||||
await updateSettings(payload)
|
||||
toast.success("Settings saved successfully!")
|
||||
onOpenChange(false)
|
||||
onSuccess()
|
||||
@@ -140,7 +144,7 @@ export function SettingsDialog({
|
||||
<Input
|
||||
id="imap-password"
|
||||
type="password"
|
||||
value={currentSettings.imap_password}
|
||||
value={currentSettings.imap_password ?? ""}
|
||||
onChange={(e) =>
|
||||
handleSettingsChange("imap_password", e.target.value)
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ export interface Settings {
|
||||
export interface SettingsCreate {
|
||||
imap_server: string;
|
||||
imap_username: string;
|
||||
imap_password?: string;
|
||||
imap_password?: string | null;
|
||||
search_folder: string;
|
||||
move_to_folder?: string | null;
|
||||
mark_as_read: boolean;
|
||||
|
||||
Reference in New Issue
Block a user