From f586399c8534664b13b2870959909881d1369b55 Mon Sep 17 00:00:00 2001
From: Robert Goldmann <deadlocker@gmx.de>
Date: Sun, 2 Jul 2023 18:05:29 +0200
Subject: [PATCH] only send transaction name suggestions once

---
 .../resources/templates/transactions/transactionImport.ftl    | 4 ++++
 .../templates/transactions/transactionImportMacros.ftl        | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/BudgetMasterServer/src/main/resources/templates/transactions/transactionImport.ftl b/BudgetMasterServer/src/main/resources/templates/transactions/transactionImport.ftl
index 34cda1496..7f86b9535 100644
--- a/BudgetMasterServer/src/main/resources/templates/transactions/transactionImport.ftl
+++ b/BudgetMasterServer/src/main/resources/templates/transactions/transactionImport.ftl
@@ -27,6 +27,10 @@
                     </div>
                 </div>
 
+                <script>
+                    transactionNameSuggestions = {};
+                </script>
+
                 <@header.content>
                     <div class="container">
                         <#if csvRows??>
diff --git a/BudgetMasterServer/src/main/resources/templates/transactions/transactionImportMacros.ftl b/BudgetMasterServer/src/main/resources/templates/transactions/transactionImportMacros.ftl
index 86fdd0c0d..b383e17c5 100644
--- a/BudgetMasterServer/src/main/resources/templates/transactions/transactionImportMacros.ftl
+++ b/BudgetMasterServer/src/main/resources/templates/transactions/transactionImportMacros.ftl
@@ -186,6 +186,8 @@
             </tbody>
         </table>
     </div>
+
+    <@newTransactionMacros.insertNameSuggestions/>
 </#macro>
 
 <#macro renderCsvTransaction csvTransaction index>
@@ -240,8 +242,6 @@
             </td>
         </form>
     </tr>
-
-    <@newTransactionMacros.insertNameSuggestions/>
 </#macro>
 
 <#macro showColumnSettingsErrors>
-- 
GitLab