Răsfoiți Sursa

Update transactions to only display new transaction if it is one of the most recent.

Lee Morgan 5 ani în urmă
părinte
comite
80d5ade74c
1 a modificat fișierele cu 4 adăugiri și 3 ștergeri
  1. 4 3
      views/dashboardPage/js/sidebars/newTransaction.js

+ 4 - 3
views/dashboardPage/js/sidebars/newTransaction.js

@@ -75,9 +75,10 @@ let newTransaction = {
                     if(typeof(response) === "string"){
                         controller.createBanner(response, "error");
                     }else{
-                        merchant.addTransactions([response], true);
-                        state.updateTransactions();
-
+                        if(new Date(response.date) > merchant.transactions[merchant.transactions.length-1].date){
+                            merchant.addTransactions([response], true);
+                            state.updateTransactions();
+                        }
                         controller.openStrand("transactions", merchant.getTransactions());
                         controller.createBanner("TRANSACTION CREATED", "success");
                     }