Преглед изворни кода

Bug fix: newly created accounts were not including the id.

Lee Morgan пре 11 месеци
родитељ
комит
9feb4a586d

+ 1 - 0
src/views/js/data/Account.js

@@ -106,6 +106,7 @@ export default class Account{
                 headers: {"Content-Type": "application/json"},
                 body: JSON.stringify({data: encryptedData, iv})
             });
+            response = await response.json();
         }catch(e){
             new Notifier("error", "Something went wrong, try refreshing the page");
         }

+ 2 - 1
src/views/js/data/Transaction.js

@@ -134,7 +134,8 @@ export default class Transaction{
             for(let i = 0; i < response.length; i++){
                 promises.push(Transaction.decrypt(response[i]));
             }
-
+            
+            if(promises.length === 0) return [];
             return await Promise.all(promises);
         }catch(e){
             new Notifier("error", "Something went wrong, try refreshing the page");

+ 1 - 1
src/views/js/pages/Home.js

@@ -20,7 +20,7 @@ export default class Home extends Page{
             
             Transaction.fetch(user.account.id, from, to)
                 .then((transactions)=>{
-                    user.account.addManyTransactions(transactions);
+                    if(transactions.length > 0) user.account.addManyTransactions(transactions);
                     user.account.isPopulated = true;
                 })
                 .catch((err)=>{

+ 0 - 1
src/views/js/pages/Login.js

@@ -71,7 +71,6 @@ export default class Login extends Page{
                 changePage("home");
             })
             .catch((err)=>{
-                console.log(err);
                 if(err.error){
                     new Notifier("error", err.error.message);
                 }else{