From e721a96dafae77c8d4871af44477d9b5efac2385 Mon Sep 17 00:00:00 2001 From: Kylan Hurt Date: Wed, 13 Sep 2017 20:02:36 -0700 Subject: [PATCH 1/5] Log file officially being written via disklet --- src/modules/Core/Account/api.js | 2 ++ src/modules/Core/Account/settings.js | 22 +++++++++++++++++++++ src/modules/UI/scenes/Request/Request.ui.js | 7 +++++-- src/modules/UI/scenes/Request/action.js | 6 ++++++ 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/modules/Core/Account/api.js b/src/modules/Core/Account/api.js index 3ddbc7bc2ec..45f6a0f35d5 100644 --- a/src/modules/Core/Account/api.js +++ b/src/modules/Core/Account/api.js @@ -28,10 +28,12 @@ export const deleteWalletRequest = (account, walletId) => account.changeWalletSt }) export const updateActiveWalletsOrderRequest = (account, activeWalletIds) => { + const newKeyStates = activeWalletIds.reduce((keyStates, id, index) => { keyStates[id] = {sortIndex: index} return keyStates }, {}) + console.log('newKeyStates are: ', newKeyStates) return account.changeWalletStates(newKeyStates) } diff --git a/src/modules/Core/Account/settings.js b/src/modules/Core/Account/settings.js index 6b93aa4882d..d8c058cb224 100644 --- a/src/modules/Core/Account/settings.js +++ b/src/modules/Core/Account/settings.js @@ -95,6 +95,7 @@ export const setDenominationKeyRequest = (account, currencyCode, denomination) = }) // Helper Functions + export const getSyncedSettings = (account) => getSyncedSettingsFile(account).getText() .then(text => JSON.parse(text)) @@ -117,6 +118,19 @@ export async function setSubcategoriesRequest (account, subcategories) { return setSyncedSubcategories(account, subcategories) } +export async function setLocalLog (account, log) { + const logFile = getLocalLogFile(account) + let oldLogs = logFile.getText() + .then((txt) => txt) + let newLogs = oldLogs + log + console.log('in setSyncedLog, account is: ', account, ' , and log is: ', log, ' , logFile is: ', logFile, ' and oldLogs are : ', oldLogs, ' , newLogs is: ', newLogs) + try { + await logFile.setText(newLogs) + } catch (e) { + console.log('setLocalLog error: ', e) + } +} + export async function setSyncedSubcategories (account, subcategories) { let finalText = {} if (!subcategories.categories) { @@ -133,6 +147,8 @@ export async function setSyncedSubcategories (account, subcategories) { } } + + export const getSyncedSubcategories = account => { dumpFolder(account.folder) return getSyncedSubcategoriesFile(account).getText() @@ -150,6 +166,10 @@ export const getSyncedSubcategories = account => { export const getSyncedSubcategoriesFile = account => account.folder.file('Categories.json') +export async function setLocalLogRequest (account, log) { + return setLocalLog(account, log) +} + export const getLocalSettings = account => getLocalSettingsFile(account).getText() .then(text => JSON.parse(text)) @@ -174,6 +194,8 @@ export const getCoreSettings = () => { return Promise.resolve(coreSettings) } +export const getLocalLogFile = account => account.folder.file('Log.txt') + export const getSyncedSettingsFile = account => account.folder.file('Settings.json') export const getLocalSettingsFile = account => account.localFolder.file('Settings.json') diff --git a/src/modules/UI/scenes/Request/Request.ui.js b/src/modules/UI/scenes/Request/Request.ui.js index 37a98b301c4..04c37817e9c 100644 --- a/src/modules/UI/scenes/Request/Request.ui.js +++ b/src/modules/UI/scenes/Request/Request.ui.js @@ -21,7 +21,7 @@ import * as CORE_SELECTORS from '../../../Core/selectors.js' import * as UI_SELECTORS from '../../selectors.js' import * as SETTINGS_SELECTORS from '../../Settings/selectors.js' -import {saveReceiveAddress} from './action.js' +import {saveReceiveAddress, saveToLog} from './action.js' class Request extends Component { constructor (props) { @@ -35,10 +35,13 @@ class Request extends Component { componentWillReceiveProps (nextProps) { if (nextProps.coreWallet.id !== this.props.coreWallet.id) { - const {coreWallet, currencyCode} = nextProps + const {coreWallet, currencyCode} = nextProps + console.log('inside of Request.ui.js->componentWillReceiveProps, nextProps is: ', nextProps) WALLET_API.getReceiveAddress(coreWallet, currencyCode) .then(receiveAddress => { const {publicAddress} = receiveAddress + console.log('in request->ComponentWillReceiveProps, receiveAddress is: ', receiveAddress, ' , coreWallet is: ', coreWallet, ' , and currencyCode is: ', currencyCode) + this.props.dispatch(saveToLog('testing')) const encodedURI = this.props.coreWallet.encodeUri(receiveAddress) this.setState({ encodedURI, diff --git a/src/modules/UI/scenes/Request/action.js b/src/modules/UI/scenes/Request/action.js index dc957ab3452..bd33a9b066a 100644 --- a/src/modules/UI/scenes/Request/action.js +++ b/src/modules/UI/scenes/Request/action.js @@ -6,6 +6,7 @@ export const SAVE_RECEIVE_ADDRESS = 'SAVE_RECEIVE_ADDRESS' export const UPDATE_INPUT_CURRENCY_SELECTED = 'UPDATE_INPUT_CURRENCY_SELECTED' import * as CORE_SELECTORS from '../../../Core/selectors.js' +import * as SETTINGS_API from '../../../Core/Account/settings.js' import * as UI_SELECTORS from '../../../UI/selectors.js' import * as WALLET_API from '../../../Core/Wallets/api.js' @@ -31,6 +32,11 @@ export const updateInputCurrencySelected = inputCurrencySelected => ({ data: {inputCurrencySelected} }) +export const saveToLog = (newLog) => (dispatch, getState) => { + console.log('inside of request->action.saveToLog, newLog is: ', newLog) + SETTINGS_API.setLocalLog(CORE_SELECTORS.getAccount(getState()) , newLog) +} + export const saveReceiveAddress = receiveAddress => (dispatch, getState) => { const state = getState() const selectedWalletId = UI_SELECTORS.getSelectedWalletId(state) From 0aa886a9ce49eb6cff93e11dd688d34e12be4616 Mon Sep 17 00:00:00 2001 From: Kylan Hurt Date: Tue, 19 Sep 2017 13:12:13 -0700 Subject: [PATCH 2/5] Provisional completion of sortPersistence --- src/modules/UI/Settings/selectors.js | 15 ++- .../UI/scenes/WalletList/WalletList.ui.js | 49 +++---- .../scenes/WalletList/WalletListConnector.js | 3 +- .../WalletListRow/FullWalletListRow.ui.js | 123 ++++++++++++++---- .../FullWalletListRowConnector.js | 20 +-- .../WalletListRow/SortableWalletListRow.ui.js | 94 +++++++------ 6 files changed, 191 insertions(+), 113 deletions(-) diff --git a/src/modules/UI/Settings/selectors.js b/src/modules/UI/Settings/selectors.js index f45e3996124..bd543f0f3a1 100644 --- a/src/modules/UI/Settings/selectors.js +++ b/src/modules/UI/Settings/selectors.js @@ -37,6 +37,14 @@ export const getDisplayDenominationKey = (state: any, currencyCode: string) => { return selectedDenominationKey } +export const getDisplayDenominationFromSettings = (settings: any, currencyCode: string) => { + const currencySettings = settings[currencyCode] || isoFiatDenominations[currencyCode] + const selectedDenominationKey = currencySettings.denomination + const denominations = currencySettings.denominations + const selectedDenomination = denominations.find((denomination) => denomination.multiplier === selectedDenominationKey) + return selectedDenomination +} + export const getDisplayDenomination = (state: any, currencyCode: string) => { const selectedDenominationKey = getDisplayDenominationKey(state, currencyCode) const denominations = getDenominations(state, currencyCode) @@ -67,11 +75,6 @@ export const getBitcoinPlugin = (state: any) => { return bitcoinPlugin } -export const getLitecoinPlugin = (state: any) => { - const litecoinPlugin = getPlugin(state, 'litecoin') - return litecoinPlugin -} - export const getEthereumPlugin = (state: any) => { const ethereumPlugin = getPlugin(state, 'ethereum') return ethereumPlugin @@ -100,4 +103,4 @@ export const getAutoLogoutTimeInMinutes = (state: any) => { const autoLogoutTimeInSeconds = getAutoLogoutTimeInSeconds(state) const autoLogoutTimeInMinutes = autoLogoutTimeInSeconds / 60 return autoLogoutTimeInMinutes -} +} \ No newline at end of file diff --git a/src/modules/UI/scenes/WalletList/WalletList.ui.js b/src/modules/UI/scenes/WalletList/WalletList.ui.js index 8adf0e04406..4f95504d2cb 100644 --- a/src/modules/UI/scenes/WalletList/WalletList.ui.js +++ b/src/modules/UI/scenes/WalletList/WalletList.ui.js @@ -20,7 +20,7 @@ import {Actions} from 'react-native-router-flux' import styles from './style' import SortableListView from 'react-native-sortable-listview' import FullWalletListRow from './components/WalletListRow/FullWalletListRowConnector' -import SortableWalletListRow from './components/WalletListRow/SortableWalletListRowConnector' +import SortableWalletListRow from './components/WalletListRow/SortableWalletListRow.ui.js' import strings from '../../../../locales/default' import {sprintf} from 'sprintf-js' @@ -118,17 +118,30 @@ export default class WalletList extends Component { break } } - render () { // console.log('beginning of walletList render, this is: ', this.state) const {wallets} = this.props let walletsArray = [] + let activeWallets = {} for (let wallet in wallets) { let theWallet = wallets[wallet] theWallet.key = wallet theWallet.executeWalletRowOption = this.executeWalletRowOption walletsArray.push(theWallet) + if (this.props.activeWalletIds.includes(wallet)) activeWallets[wallet] = wallets[wallet] } + + let activeWalletsArray = this.props.activeWalletIds.map(function (x) { + let tempWalletObj = {key: x} + return wallets[x] || tempWalletObj + }) + + let activeWalletsObject = {} + this.props.activeWalletIds.forEach(function (x) { + let tempWalletObj = wallets[x] ? wallets[x] : {key: null} + activeWalletsObject[x] = tempWalletObj + }) + return ( {this.renderDeleteWalletModal()} @@ -185,9 +198,7 @@ export default class WalletList extends Component { { - Object.keys(wallets).length > 0 - ? this.renderActiveSortableList(walletsArray) - : + Object.keys(this.props.wallets).length > 0 ? this.renderActiveSortableList(activeWalletsArray, activeWalletsObject) : } @@ -195,26 +206,26 @@ export default class WalletList extends Component { ) } - renderActiveSortableList = (walletsArray: Array) => { + renderActiveSortableList = (activeWalletsArray: any, activeWalletsObject: any) => { const {width} = Dimensions.get('window') return ( - + } executeWalletRowOption={this.executeWalletRowOption} - activeOpacity={0.6} /> + dimensions={this.props.dimensions} + /> - - } sortableMode={this.state.sortableMode} @@ -224,8 +235,6 @@ export default class WalletList extends Component { ) } - renderActiveRow = (row: any) => - enableSorting = () => { // start animation, use callback to setState, then setState's callback to execute 2nd animation // console.log('enabling sorting, this is: ', this) @@ -333,11 +342,7 @@ export default class WalletList extends Component { } onActiveRowMoved = (action: any) => { - const wallets = this.props.wallets - const activeOrderedWallets = Object.keys(wallets).filter((key) => !wallets[key].archived) // filter out archived wallets - .sort((a, b) => wallets[a].sortIndex - wallets[b].sortIndex) // sort them according to their (previous) sortIndices - const order = activeOrderedWallets - const newOrder = this.getNewOrder(order, action) // pass the old order to getNewOrder with the action ( from, to, and ) + const newOrder = this.getNewOrder(this.props.activeWalletIds, action) // pass the old order to getNewOrder with the action ( from, to, and ) this.props.updateActiveWalletsOrder(newOrder) this.forceUpdate() diff --git a/src/modules/UI/scenes/WalletList/WalletListConnector.js b/src/modules/UI/scenes/WalletList/WalletListConnector.js index 9a70cbae17b..776fe5e3593 100644 --- a/src/modules/UI/scenes/WalletList/WalletListConnector.js +++ b/src/modules/UI/scenes/WalletList/WalletListConnector.js @@ -27,7 +27,8 @@ const mapStateToProps = (state) => { walletName: state.ui.scenes.walletList.walletName, walletId: state.ui.scenes.walletList.walletId, walletOrder: state.ui.wallets.walletListOrder, - currencyConverter + currencyConverter, + dimensions: state.ui.scenes.dimensions } } diff --git a/src/modules/UI/scenes/WalletList/components/WalletListRow/FullWalletListRow.ui.js b/src/modules/UI/scenes/WalletList/components/WalletListRow/FullWalletListRow.ui.js index 14b78859be2..8e54a9627f9 100644 --- a/src/modules/UI/scenes/WalletList/components/WalletListRow/FullWalletListRow.ui.js +++ b/src/modules/UI/scenes/WalletList/components/WalletListRow/FullWalletListRow.ui.js @@ -5,22 +5,54 @@ import {bns} from 'biggystring' import { View, TouchableHighlight, - Animated, + ActivityIndicator } from 'react-native' +import {connect} from 'react-redux' import {Actions} from 'react-native-router-flux' -import styles from '../../style' -import T from '../../../../components/FormattedText/FormattedText.ui' +import styles from '../../style.js' +import T from '../../../../components/FormattedText' import RowOptions from './WalletListRowOptions.ui' -import WalletListTokenRow from './WalletListTokenRowConnector' -import * as UTILS from '../../../../../utils' +import WalletListTokenRow from './WalletListTokenRowConnector.js' +import {border as b, cutOffText, truncateDecimals} from '../../../../../utils.js' +import {selectWallet} from '../../../../Wallets/action.js' +import * as SETTINGS_SELECTORS from '../../../../Settings/selectors' + +export const findDenominationSymbol = (denoms, value) => { + for (const v of denoms) { + if (v.name === value) { + return v.symbol + } + } +} + + +class FullWalletRow extends Component { + render () { + console.log('rendering FullWalletRow, this is: ', this) + return ( + + {this.props.data.item.id ? ( + + ) : ( + + )} + + ) + } +} + +export default FullWalletRow + +class FullWalletListRow extends Component { -export default class FullWalletListRow extends Component { _onPressSelectWallet = (walletId, currencyCode) => { - this.props.selectWallet(walletId, currencyCode) + this.props.dispatch(selectWallet(walletId, currencyCode)) Actions.transactionList({params: 'walletList'}) } render () { + //console.log('in FullWalletListRow, this is: ', this) + console.log('in FullWalletListRow, this is: ', this) const {data} = this.props let walletData = data.item let currencyCode = walletData.currencyCode @@ -30,27 +62,30 @@ export default class FullWalletListRow extends Component { let name = walletData.name || sprintf(strings.enUS['string_no_name']) let symbol = denomination.symbol return ( - - this._onPressSelectWallet(id, currencyCode)}> - - - {UTILS.cutOffText(name, 34)} - - - - {UTILS.truncateDecimals(bns.divf(walletData.primaryNativeBalance, multiplier).toString(), 6)} - - {walletData.currencyCode} ({symbol || ''}) - - + + + this._onPressSelectWallet(id, currencyCode)} + > + + + {cutOffText(name, 34)} + + + + {truncateDecimals(bns.divf(walletData.primaryNativeBalance, multiplier).toString(), 6)} + + {walletData.currencyCode} ({symbol || ''}) + + + + + {this.renderTokenRow(id, walletData.nativeBalances, this.props.active)} - - {this.renderTokenRow(id, walletData.nativeBalances, this.props.active)} - + ) } @@ -66,3 +101,37 @@ export default class FullWalletListRow extends Component { return tokens } } + +const mapStateToProps = (state, ownProps) => { + const displayDenomination = SETTINGS_SELECTORS.getDisplayDenomination(state, ownProps.data.item.currencyCode) + const exchangeDenomination = SETTINGS_SELECTORS.getExchangeDenomination(state, ownProps.data.item.currencyCode) + return { + dimensions: state.ui.scenes.dimensions, + displayDenomination, + exchangeDenomination + } +} +const mapDispatchToProps = (dispatch) => ({ + selectWallet: (walletId, currencyCode) => dispatch(selectWallet(walletId, currencyCode)) +}) + +export const FullWalletListRowConnect = connect(mapStateToProps, mapDispatchToProps)(FullWalletListRow) + +class FullListRowEmptyData extends Component { + render () { + //console.log('RENDERING EMPTY ROW') + return ( + + + + + + + + ) + } +} \ No newline at end of file diff --git a/src/modules/UI/scenes/WalletList/components/WalletListRow/FullWalletListRowConnector.js b/src/modules/UI/scenes/WalletList/components/WalletListRow/FullWalletListRowConnector.js index 07cb91a3484..6a037ad9236 100644 --- a/src/modules/UI/scenes/WalletList/components/WalletListRow/FullWalletListRowConnector.js +++ b/src/modules/UI/scenes/WalletList/components/WalletListRow/FullWalletListRowConnector.js @@ -1,21 +1,3 @@ -import {connect} from 'react-redux' import FullWalletListRow from './FullWalletListRow.ui' -import {selectWallet} from '../../../../Wallets/action' -import * as SETTINGS_SELECTORS from '../../../../Settings/selectors' - -const mapStateToProps = (state, ownProps) => { - const displayDenomination = SETTINGS_SELECTORS.getDisplayDenomination(state, ownProps.data.item.currencyCode) - const exchangeDenomination = SETTINGS_SELECTORS.getExchangeDenomination(state, ownProps.data.item.currencyCode) - - return { - dimensions: state.ui.scenes.dimensions, - displayDenomination, - exchangeDenomination - } -} -const mapDispatchToProps = (dispatch) => ({ - selectWallet: (walletId, currencyCode) => dispatch(selectWallet(walletId, currencyCode)) -}) - -export default connect(mapStateToProps, mapDispatchToProps)(FullWalletListRow) +export default FullWalletListRow \ No newline at end of file diff --git a/src/modules/UI/scenes/WalletList/components/WalletListRow/SortableWalletListRow.ui.js b/src/modules/UI/scenes/WalletList/components/WalletListRow/SortableWalletListRow.ui.js index 424fd758e6d..18bf98407a3 100644 --- a/src/modules/UI/scenes/WalletList/components/WalletListRow/SortableWalletListRow.ui.js +++ b/src/modules/UI/scenes/WalletList/components/WalletListRow/SortableWalletListRow.ui.js @@ -1,19 +1,21 @@ import React, {Component} from 'react' +import {connect} from 'react-redux' import strings from '../../../../../../locales/default' import {sprintf} from 'sprintf-js' import {bns} from 'biggystring' import { View, TouchableHighlight, - Animated, - Image + Image, + ActivityIndicator } from 'react-native' -import styles from '../../style' -import T from '../../../../components/FormattedText/FormattedText.ui' -import * as UTILS from '../../../../../utils' -import sort from '../../../../../../../src/assets/images/walletlist/sort.png' +import styles from '../../style.js' +import T from '../../../../components/FormattedText' +import {border as b, cutOffText, truncateDecimals} from '../../../../../utils' +import sort from '../../../../../../assets/images/walletlist/sort.png' +import * as SETTINGS_SELECTORS from '../../../../Settings/selectors' -export const findDenominationSymbol = (denoms, value) => { +const findDenominationSymbol = (denoms, value) => { for (const v of denoms) { if (v.name === value) { return v.symbol @@ -21,43 +23,59 @@ export const findDenominationSymbol = (denoms, value) => { } } -export default class SortableWalletListRow extends Component { +class SortableWalletListRow extends Component { + render () { const {data} = this.props let walletData = data - let currencyCode = walletData.currencyCode - let multiplier = this.props.displayDenomination.multiplier - let name = walletData.name || sprintf(strings.enUS['string_no_name']) - let symbol = findDenominationSymbol(walletData.denominations, currencyCode) + let multiplier, name, symbol + // const exchangeDenomination = SETTINGS_SELECTORS.getExchangeDenomination(state, data.currencyCode) + if (walletData.currencyCode) { + let displayDenomination = SETTINGS_SELECTORS.getDisplayDenominationFromSettings(this.props.settings, data.currencyCode) + multiplier = displayDenomination.multiplier + name = walletData.name || sprintf(strings.enUS['string_no_name']) + symbol = findDenominationSymbol(walletData.denominations, walletData.currencyCode) + } + console.log('rendering SortableWalletListRow, walletData is: ', walletData, ' this is: ', this) return ( - - - - - - - {UTILS.cutOffText(name, 34)} - + + {walletData.currencyCode? ( + + + {cutOffText(name, 34)} + + + {truncateDecimals(bns.divf(walletData.primaryNativeBalance, multiplier).toString(), 6)} + {walletData.currencyCode} + ({symbol || ''}) + + + + - - - - {UTILS.truncateDecimals(bns.divf(walletData.primaryNativeBalance, multiplier).toString(), 6)} - - - {currencyCode} ({symbol || ''}) - - - - - - - - + ) : ( + + + + + + )} - ) } } + +export default connect((state) => { + const settings = state.ui.settings + + return { + settings + } +})(SortableWalletListRow) \ No newline at end of file From b1b4b579fd0da92ca14b74bb8498fe7242518125 Mon Sep 17 00:00:00 2001 From: Kylan Hurt Date: Tue, 19 Sep 2017 13:33:59 -0700 Subject: [PATCH 3/5] Remove unnecessary file logging functions --- src/modules/Core/Account/settings.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/modules/Core/Account/settings.js b/src/modules/Core/Account/settings.js index 2e1aff63785..e9886590902 100644 --- a/src/modules/Core/Account/settings.js +++ b/src/modules/Core/Account/settings.js @@ -121,18 +121,6 @@ export async function setSubcategoriesRequest (account, subcategories) { return setSyncedSubcategories(account, subcategories) } -export async function setLocalLog (account, log) { - const logFile = getLocalLogFile(account) - let oldLogs = logFile.getText() - .then((txt) => txt) - let newLogs = oldLogs + log - try { - await logFile.setText(newLogs) - } catch (e) { - console.log('setLocalLog error: ', e) - } -} - export async function setSyncedSubcategories (account, subcategories) { let finalText = {} if (!subcategories.categories) { @@ -163,10 +151,6 @@ export const getSyncedSubcategories = (account) => getSyncedSubcategoriesFile(ac export const getSyncedSubcategoriesFile = (account) => account.folder.file('Categories.json') -export async function setLocalLogRequest (account, log) { - return setLocalLog(account, log) -} - export const getLocalSettings = (account) => getLocalSettingsFile(account).getText() .then((text) => JSON.parse(text)) @@ -190,8 +174,6 @@ export const getCoreSettings = () => { return Promise.resolve(coreSettings) } -export const getLocalLogFile = (account) => account.folder.file('Log.txt') - export const getSyncedSettingsFile = (account) => account.folder.file('Settings.json') export const getLocalSettingsFile = (account) => account.localFolder.file('Settings.json') From f731d7d8d3e697c4f04af9629ade6020eb12c331 Mon Sep 17 00:00:00 2001 From: Kylan Hurt Date: Tue, 19 Sep 2017 15:04:44 -0700 Subject: [PATCH 4/5] Clean up some console logging and walletList sorting functionality --- src/modules/UI/scenes/WalletList/WalletList.ui.js | 5 ----- src/modules/UI/scenes/WalletList/action.js | 4 ---- .../components/WalletListRow/FullWalletListRow.ui.js | 6 +----- .../components/WalletListRow/SortableWalletListRow.ui.js | 1 - 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/modules/UI/scenes/WalletList/WalletList.ui.js b/src/modules/UI/scenes/WalletList/WalletList.ui.js index 4f95504d2cb..d19e224b8e9 100644 --- a/src/modules/UI/scenes/WalletList/WalletList.ui.js +++ b/src/modules/UI/scenes/WalletList/WalletList.ui.js @@ -74,7 +74,6 @@ export default class WalletList extends Component { } componentDidMount () { - console.log('in WalletList->componentDidMount') Permissions.request('contacts').then((response) => { if (response === 'authorized') { Contacts.getAll((err, contacts) => { @@ -90,7 +89,6 @@ export default class WalletList extends Component { } executeWalletRowOption = (walletId: string, option: string) => { - // console.log('in executeWalletRowOption, option is: ', option) switch (option) { case options[0].value: // 'rename' console.log('executing rename') @@ -119,7 +117,6 @@ export default class WalletList extends Component { } } render () { - // console.log('beginning of walletList render, this is: ', this.state) const {wallets} = this.props let walletsArray = [] let activeWallets = {} @@ -237,7 +234,6 @@ export default class WalletList extends Component { enableSorting = () => { // start animation, use callback to setState, then setState's callback to execute 2nd animation - // console.log('enabling sorting, this is: ', this) let sortableToOpacity = 1 let sortableListToZIndex = 100 let fullListToOpacity = 0 @@ -276,7 +272,6 @@ export default class WalletList extends Component { } disableSorting = () => { - // console.log('disabling sorting') let sortableToOpacity = 0 let sortableListToZIndex = 0 let fullListToOpacity = 1 diff --git a/src/modules/UI/scenes/WalletList/action.js b/src/modules/UI/scenes/WalletList/action.js index 5362b92823e..384e7aab956 100644 --- a/src/modules/UI/scenes/WalletList/action.js +++ b/src/modules/UI/scenes/WalletList/action.js @@ -115,11 +115,7 @@ export const updateActiveWalletsOrder = (activeWalletIds) => (dispatch, getState dispatch(updateActiveWalletsOrderStart(activeWalletIds)) ACCOUNT_API.updateActiveWalletsOrderRequest(account, activeWalletIds) .then(() => { - // console.log('response', response) dispatch(updateActiveWalletsOrderSuccess(activeWalletIds)) - for (let k in activeWalletIds) { - dispatch(updateIndividualWalletSortIndex(activeWalletIds[k], k)) - } }) .catch((e) => console.log(e)) } diff --git a/src/modules/UI/scenes/WalletList/components/WalletListRow/FullWalletListRow.ui.js b/src/modules/UI/scenes/WalletList/components/WalletListRow/FullWalletListRow.ui.js index 8e54a9627f9..50f930585e2 100644 --- a/src/modules/UI/scenes/WalletList/components/WalletListRow/FullWalletListRow.ui.js +++ b/src/modules/UI/scenes/WalletList/components/WalletListRow/FullWalletListRow.ui.js @@ -28,7 +28,6 @@ export const findDenominationSymbol = (denoms, value) => { class FullWalletRow extends Component { render () { - console.log('rendering FullWalletRow, this is: ', this) return ( {this.props.data.item.id ? ( @@ -46,13 +45,11 @@ export default FullWalletRow class FullWalletListRow extends Component { _onPressSelectWallet = (walletId, currencyCode) => { - this.props.dispatch(selectWallet(walletId, currencyCode)) + this.props.selectWallet(walletId, currencyCode) Actions.transactionList({params: 'walletList'}) } render () { - //console.log('in FullWalletListRow, this is: ', this) - console.log('in FullWalletListRow, this is: ', this) const {data} = this.props let walletData = data.item let currencyCode = walletData.currencyCode @@ -119,7 +116,6 @@ export const FullWalletListRowConnect = connect(mapStateToProps, mapDispatchToP class FullListRowEmptyData extends Component { render () { - //console.log('RENDERING EMPTY ROW') return ( Date: Tue, 19 Sep 2017 15:11:18 -0700 Subject: [PATCH 5/5] Small adjustments for standard.js --- src/modules/Core/Account/api.js | 2 -- src/modules/Core/Account/settings.js | 1 - 2 files changed, 3 deletions(-) diff --git a/src/modules/Core/Account/api.js b/src/modules/Core/Account/api.js index 2ead8638c21..97c1daeca8c 100644 --- a/src/modules/Core/Account/api.js +++ b/src/modules/Core/Account/api.js @@ -26,12 +26,10 @@ export const deleteWalletRequest = (account, walletId) => account.changeWalletSt }) export const updateActiveWalletsOrderRequest = (account, activeWalletIds) => { - const newKeyStates = activeWalletIds.reduce((keyStates, id, index) => { keyStates[id] = {sortIndex: index} return keyStates }, {}) - console.log('newKeyStates are: ', newKeyStates) return account.changeWalletStates(newKeyStates) } diff --git a/src/modules/Core/Account/settings.js b/src/modules/Core/Account/settings.js index e9886590902..2983ce5c2dc 100644 --- a/src/modules/Core/Account/settings.js +++ b/src/modules/Core/Account/settings.js @@ -139,7 +139,6 @@ export async function setSyncedSubcategories (account, subcategories) { export const getSyncedSubcategories = (account) => getSyncedSubcategoriesFile(account).getText() .then((text) => { - let categoriesText = JSON.parse(text) return categoriesText.categories })