updates for cross-device sync #130
2 changed files with 6 additions and 0 deletions
3
dist/bundle.js
vendored
3
dist/bundle.js
vendored
|
@ -3629,6 +3629,7 @@ function doUpdateBalance() {
|
|||
|
||||
_lbry2.default.account_balance().then(function (balanceAsString) {
|
||||
var balance = parseFloat(balanceAsString);
|
||||
console.log('balance=' + balance);
|
||||
|
||||
if (balanceInStore !== balance) {
|
||||
dispatch({
|
||||
|
@ -3650,10 +3651,12 @@ function doUpdateTotalBalance() {
|
|||
_lbry2.default.account_list().then(function (accountList) {
|
||||
var accounts = accountList.lbc_mainnet;
|
||||
|
||||
console.log(accountList);
|
||||
var totalSatoshis = accounts.length === 1 ? accounts[0].satoshis : accounts.reduce(function (a, b) {
|
||||
return a.satoshis + b.satoshis;
|
||||
});
|
||||
var totalBalance = (Number.isNaN(totalSatoshis) ? 0 : totalSatoshis) / Math.pow(10, 8);
|
||||
console.log(totalBalance);
|
||||
if (totalBalanceInStore !== totalBalance) {
|
||||
dispatch({
|
||||
type: ACTIONS.UPDATE_TOTAL_BALANCE,
|
||||
|
|
|
@ -11,6 +11,7 @@ export function doUpdateBalance() {
|
|||
} = getState();
|
||||
Lbry.account_balance().then(balanceAsString => {
|
||||
const balance = parseFloat(balanceAsString);
|
||||
console.log(`balance=${balance}`);
|
||||
|
||||
if (balanceInStore !== balance) {
|
||||
dispatch({
|
||||
|
@ -31,11 +32,13 @@ export function doUpdateTotalBalance() {
|
|||
} = getState();
|
||||
Lbry.account_list().then(accountList => {
|
||||
const { lbc_mainnet: accounts } = accountList;
|
||||
console.log(accountList);
|
||||
const totalSatoshis =
|
||||
accounts.length === 1
|
||||
? accounts[0].satoshis
|
||||
: accounts.reduce((a, b) => a.satoshis + b.satoshis);
|
||||
const totalBalance = (Number.isNaN(totalSatoshis) ? 0 : totalSatoshis) / 10 ** 8;
|
||||
console.log(totalBalance);
|
||||
if (totalBalanceInStore !== totalBalance) {
|
||||
dispatch({
|
||||
type: ACTIONS.UPDATE_TOTAL_BALANCE,
|
||||
|
|
Loading…
Add table
Reference in a new issue