diff --git a/packages/desktop-client/src/components/modals/ImportTransactionsModal.jsx b/packages/desktop-client/src/components/modals/ImportTransactionsModal.jsx index 4a74a10b70f..e7602ec9732 100644 --- a/packages/desktop-client/src/components/modals/ImportTransactionsModal.jsx +++ b/packages/desktop-client/src/components/modals/ImportTransactionsModal.jsx @@ -857,8 +857,6 @@ export function ImportTransactionsModal({ options }) { const [filetype, setFileType] = useState(null); const [fieldMappings, setFieldMappings] = useState(null); const [splitMode, setSplitMode] = useState(false); - const [inOutMode, setInOutMode] = useState(false); - const [outValue, setOutValue] = useState(''); const [flipAmount, setFlipAmount] = useState(false); const [multiplierEnabled, setMultiplierEnabled] = useState(false); const [reconcile, setReconcile] = useState(true); @@ -876,6 +874,12 @@ export function ImportTransactionsModal({ options }) { const [skipLines, setSkipLines] = useState( parseInt(prefs[`csv-skip-lines-${accountId}`], 10) || 0, ); + const [inOutMode, setInOutMode] = useState( + String(prefs[`csv-in-out-mode-${accountId}`]) === 'true', + ); + const [outValue, setOutValue] = useState( + prefs[`csv-out-value-${accountId}`] ?? '', + ); const [hasHeaderRow, setHasHeaderRow] = useState( String(prefs[`csv-has-header-${accountId}`]) !== 'false', ); @@ -1344,6 +1348,8 @@ export function ImportTransactionsModal({ options }) { savePrefs({ [`csv-delimiter-${accountId}`]: delimiter }); savePrefs({ [`csv-has-header-${accountId}`]: String(hasHeaderRow) }); savePrefs({ [`csv-skip-lines-${accountId}`]: String(skipLines) }); + savePrefs({ [`csv-in-out-mode-${accountId}`]: String(inOutMode) }); + savePrefs({ [`csv-out-value-${accountId}`]: String(outValue) }); } if (filetype === 'csv' || filetype === 'qif') { diff --git a/packages/loot-core/src/types/prefs.d.ts b/packages/loot-core/src/types/prefs.d.ts index f1066746732..ed0f8392064 100644 --- a/packages/loot-core/src/types/prefs.d.ts +++ b/packages/loot-core/src/types/prefs.d.ts @@ -24,6 +24,8 @@ export type SyncedPrefs = Partial< | `csv-mappings-${string}` | `csv-delimiter-${string}` | `csv-skip-lines-${string}` + | `csv-in-out-mode-${string}` + | `csv-out-value-${string}` | `csv-has-header-${string}` | `ofx-fallback-missing-payee-${string}` | `flip-amount-${string}-${'csv' | 'qif'}`