Update App.js

This commit is contained in:
marcosrdz 2020-12-27 12:06:24 -05:00 committed by Overtorment
parent 5a0121c2a5
commit 0121b8ed82

30
App.js
View file

@ -68,22 +68,20 @@ const App = () => {
const payload = Object.assign({}, notification, notification.data); const payload = Object.assign({}, notification, notification.data);
if (notification.data && notification.data.data) Object.assign(payload, notification.data.data); if (notification.data && notification.data.data) Object.assign(payload, notification.data.data);
delete payload.data; delete payload.data;
if (payload) { let wallet;
let wallet; switch (+payload.type) {
switch (+payload.type) { case 2:
case 2: case 3:
case 3: wallet = wallets.find(w => w.weOwnAddress(payload.address));
wallet = wallets.find(w => w.weOwnAddress(payload.address)); break;
break; case 1:
case 1: case 4:
case 4: wallet = wallets.find(w => w.weOwnTransaction(payload.txid || payload.hash));
wallet = wallets.find(w => w.weOwnTransaction(payload.txid || payload.hash)); break;
break; }
} if (wallet) {
if (wallet) { const walletID = wallet.getID();
const walletID = wallet.getID(); fetchAndSaveWalletTransactions(walletID);
fetchAndSaveWalletTransactions(walletID);
}
} }
}; };