diff --git a/src/common/parse.js b/src/common/parse.js index 01998f6d..4a439383 100644 --- a/src/common/parse.js +++ b/src/common/parse.js @@ -251,9 +251,9 @@ class ParseHelper { */ static async fetchTransactions(symbol, type, address, skipCount, fetchCount) { const queryFrom = new Parse.Query(ParseTransaction); - queryFrom.equalTo('from', address); + queryFrom.equalTo('from', address.toLowerCase()); const queryTo = new Parse.Query(ParseTransaction); - queryTo.equalTo('to', address); + queryTo.equalTo('to', address.toLowerCase()); const query = Parse.Query.or(queryFrom, queryTo) .equalTo('type', type) .equalTo('symbol', symbol) @@ -261,7 +261,7 @@ class ParseHelper { const results = await query.skip(skipCount).limit(fetchCount).find(); const transactions = _.map(results, (item) => { const transaction = parseDataUtil.getTransaction(item); - const isSender = address === transaction.from; + const isSender = address.toLowerCase() === transaction.from.toLowerCase(); return parseDataUtil.getTransactionViewData(transaction, isSender); }); return transactions; @@ -272,7 +272,7 @@ class ParseHelper { * @param {*} tokens */ static async subscribeTransactions(tokens) { - const addresses = _.uniq(_.map(tokens, 'address')); + const addresses = (_.uniq(_.map(tokens, 'address'))).map((address) => address.toLowerCase()); const queryFrom = new Parse.Query(ParseTransaction); queryFrom.containedIn('from', addresses); const queryTo = new Parse.Query(ParseTransaction); diff --git a/src/common/wallet/walletManager.js b/src/common/wallet/walletManager.js index f06967d9..17149545 100644 --- a/src/common/wallet/walletManager.js +++ b/src/common/wallet/walletManager.js @@ -165,7 +165,7 @@ class WalletManager { _.each(tokenInstances, (token) => { const newToken = token; - const matchedToken = _.find(updatedItems, (item) => item.address === token.address && item.symbol === token.symbol && item.type === token.type); + const matchedToken = _.find(updatedItems, (item) => item.address.toLowerCase() === token.address.toLowerCase() && item.symbol === token.symbol && item.type === token.type); if (matchedToken) { // update balance