From 6354598d48a4e2d7f8096f2ab81bf0bfc14c8825 Mon Sep 17 00:00:00 2001
From: Matiss Janis Aboltins <matiss@mja.lv>
Date: Sun, 22 Sep 2024 20:30:59 +0100
Subject: [PATCH] :bug: (import) fix csv import checkboxes not working (#3478)

---
 .../src/components/modals/ImportTransactionsModal.jsx | 11 +----------
 upcoming-release-notes/3478.md                        |  6 ++++++
 2 files changed, 7 insertions(+), 10 deletions(-)
 create mode 100644 upcoming-release-notes/3478.md

diff --git a/packages/desktop-client/src/components/modals/ImportTransactionsModal.jsx b/packages/desktop-client/src/components/modals/ImportTransactionsModal.jsx
index feaf188bf..3d0d5dca5 100644
--- a/packages/desktop-client/src/components/modals/ImportTransactionsModal.jsx
+++ b/packages/desktop-client/src/components/modals/ImportTransactionsModal.jsx
@@ -862,7 +862,6 @@ export function ImportTransactionsModal({ options }) {
   const [flipAmount, setFlipAmount] = useState(false);
   const [multiplierEnabled, setMultiplierEnabled] = useState(false);
   const [reconcile, setReconcile] = useState(true);
-  const [previewTrigger, setPreviewTrigger] = useState(0);
   const { accountId, categories, onImported } = options;
 
   // This cannot be set after parsing the file, because changing it
@@ -1368,7 +1367,7 @@ export function ImportTransactionsModal({ options }) {
     close();
   }
 
-  const runImportPreviewCallback = useCallback(async () => {
+  const runImportPreview = useCallback(async () => {
     const transactionPreview = await getImportPreview(
       transactions,
       filetype,
@@ -1397,14 +1396,6 @@ export function ImportTransactionsModal({ options }) {
     multiplierAmount,
   ]);
 
-  useEffect(() => {
-    runImportPreviewCallback();
-  }, [previewTrigger, runImportPreviewCallback]);
-
-  function runImportPreview() {
-    setPreviewTrigger(value => value + 1);
-  }
-
   const headers = [
     { name: 'Date', width: 200 },
     { name: 'Payee', width: 'flex' },
diff --git a/upcoming-release-notes/3478.md b/upcoming-release-notes/3478.md
new file mode 100644
index 000000000..fb85dc1d5
--- /dev/null
+++ b/upcoming-release-notes/3478.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [MatissJanis]
+---
+
+CSV import - fix checkboxes not working.
-- 
GitLab