updates for cross-device sync #130

Merged
akinwale merged 7 commits from sync into master 2019-04-18 09:56:17 +02:00
3 changed files with 0 additions and 12 deletions
Showing only changes of commit 8c17d91b54 - Show all commits

4
dist/bundle.es.js vendored
View file

@ -1542,8 +1542,6 @@ function doUpdateBalance() {
} = getState(); } = getState();
lbryProxy.account_balance().then(balanceAsString => { lbryProxy.account_balance().then(balanceAsString => {
const balance = parseFloat(balanceAsString); const balance = parseFloat(balanceAsString);
console.log(`balance=${balance}`);
if (balanceInStore !== balance) { if (balanceInStore !== balance) {
dispatch({ dispatch({
type: UPDATE_BALANCE, type: UPDATE_BALANCE,
@ -1563,10 +1561,8 @@ function doUpdateTotalBalance() {
} = getState(); } = getState();
lbryProxy.account_list().then(accountList => { lbryProxy.account_list().then(accountList => {
const { lbc_mainnet: accounts } = 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 totalSatoshis = accounts.length === 1 ? accounts[0].satoshis : accounts.reduce((a, b) => a.satoshis + b.satoshis);
const totalBalance = (Number.isNaN(totalSatoshis) ? 0 : totalSatoshis) / Math.pow(10, 8); const totalBalance = (Number.isNaN(totalSatoshis) ? 0 : totalSatoshis) / Math.pow(10, 8);
console.log(totalBalance);
if (totalBalanceInStore !== totalBalance) { if (totalBalanceInStore !== totalBalance) {
dispatch({ dispatch({
type: UPDATE_TOTAL_BALANCE, type: UPDATE_TOTAL_BALANCE,

4
dist/bundle.js vendored
View file

@ -3285,8 +3285,6 @@ function doUpdateBalance() {
_lbry2.default.account_balance().then(function (balanceAsString) { _lbry2.default.account_balance().then(function (balanceAsString) {
var balance = parseFloat(balanceAsString); var balance = parseFloat(balanceAsString);
console.log('balance=' + balance);
if (balanceInStore !== balance) { if (balanceInStore !== balance) {
dispatch({ dispatch({
type: ACTIONS.UPDATE_BALANCE, type: ACTIONS.UPDATE_BALANCE,
@ -3307,12 +3305,10 @@ function doUpdateTotalBalance() {
_lbry2.default.account_list().then(function (accountList) { _lbry2.default.account_list().then(function (accountList) {
var accounts = accountList.lbc_mainnet; var accounts = accountList.lbc_mainnet;
console.log(accountList);
var totalSatoshis = accounts.length === 1 ? accounts[0].satoshis : accounts.reduce(function (a, b) { var totalSatoshis = accounts.length === 1 ? accounts[0].satoshis : accounts.reduce(function (a, b) {
return a.satoshis + b.satoshis; return a.satoshis + b.satoshis;
}); });
var totalBalance = (Number.isNaN(totalSatoshis) ? 0 : totalSatoshis) / Math.pow(10, 8); var totalBalance = (Number.isNaN(totalSatoshis) ? 0 : totalSatoshis) / Math.pow(10, 8);
console.log(totalBalance);
if (totalBalanceInStore !== totalBalance) { if (totalBalanceInStore !== totalBalance) {
dispatch({ dispatch({
type: ACTIONS.UPDATE_TOTAL_BALANCE, type: ACTIONS.UPDATE_TOTAL_BALANCE,

View file

@ -11,8 +11,6 @@ export function doUpdateBalance() {
} = getState(); } = getState();
Lbry.account_balance().then(balanceAsString => { Lbry.account_balance().then(balanceAsString => {
const balance = parseFloat(balanceAsString); const balance = parseFloat(balanceAsString);
console.log(`balance=${balance}`);
if (balanceInStore !== balance) { if (balanceInStore !== balance) {
dispatch({ dispatch({
type: ACTIONS.UPDATE_BALANCE, type: ACTIONS.UPDATE_BALANCE,
@ -32,13 +30,11 @@ export function doUpdateTotalBalance() {
} = getState(); } = getState();
Lbry.account_list().then(accountList => { Lbry.account_list().then(accountList => {
const { lbc_mainnet: accounts } = accountList; const { lbc_mainnet: accounts } = accountList;
console.log(accountList);
const totalSatoshis = const totalSatoshis =
accounts.length === 1 accounts.length === 1
? accounts[0].satoshis ? accounts[0].satoshis
: accounts.reduce((a, b) => a.satoshis + b.satoshis); : accounts.reduce((a, b) => a.satoshis + b.satoshis);
const totalBalance = (Number.isNaN(totalSatoshis) ? 0 : totalSatoshis) / 10 ** 8; const totalBalance = (Number.isNaN(totalSatoshis) ? 0 : totalSatoshis) / 10 ** 8;
console.log(totalBalance);
if (totalBalanceInStore !== totalBalance) { if (totalBalanceInStore !== totalBalance) {
dispatch({ dispatch({
type: ACTIONS.UPDATE_TOTAL_BALANCE, type: ACTIONS.UPDATE_TOTAL_BALANCE,