diff --git a/packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.jsx b/packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.jsx index d7325279b79..9aa7b0e4d98 100644 --- a/packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.jsx +++ b/packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.jsx @@ -151,8 +151,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); @@ -170,6 +168,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', ); @@ -638,6 +642,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 036d609f2d4..76d7990bfc5 100644 --- a/packages/loot-core/src/types/prefs.d.ts +++ b/packages/loot-core/src/types/prefs.d.ts @@ -25,6 +25,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'}` diff --git a/upcoming-release-notes/3543.md b/upcoming-release-notes/3543.md new file mode 100644 index 00000000000..4e151c20fc0 --- /dev/null +++ b/upcoming-release-notes/3543.md @@ -0,0 +1,6 @@ +--- +category: Enhancements +authors: [matt-fidd] +--- + +Save in/out mode settings between CSV imports