Skip to content
This repository has been archived by the owner on Dec 25, 2024. It is now read-only.

Commit

Permalink
saves insight node
Browse files Browse the repository at this point in the history
  • Loading branch information
kendricktan committed Nov 8, 2017
1 parent feceae1 commit af9e711
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
16 changes: 11 additions & 5 deletions src/containers/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { connect } from 'react-redux'

import { setContacts } from '../actions/Contacts'
import { setSecretPhrase, setSecretItems } from '../actions/Secrets'
import { setLanguage, setCurrency, setWalletPin } from '../actions/Settings'
import { setLanguage, setCurrency, setWalletPin, setInsightAPI } from '../actions/Settings'

import { ZENCASH_MOBILE_SAVE_PATH, ZENCASH_MOBILE_CONTACTS_PATH, readFromFile } from '../utils/persistentStorage'
import { phraseToSecretItems } from '../utils/wallet'
Expand Down Expand Up @@ -77,14 +77,18 @@ class App extends React.Component {
})
}

// Get settings
// Future: add insight, explorer settings
// Get settings
if (data.settings !== undefined) {
if (data.settings.language !== undefined) {
const settingsLanguage = data.settings.language
this.props.setLanguage(settingsLanguage)
}

if (data.settings.insightAPI !== undefined) {
const settingsLanguage = data.settings.insightAPI
this.props.setInsightAPI(settingsLanguage)
}

if (data.settings.currency !== undefined && data.settings.currency !== null) {
const settingsCurrency = data.settings.currency
this.props.setCurrency(settingsCurrency)
Expand Down Expand Up @@ -168,7 +172,8 @@ App.propTypes = {
setCurrency: PropTypes.func.isRequired,
setContacts: PropTypes.func.isRequired,
context: PropTypes.object.isRequired,
navigator: PropTypes.object.isRequired
navigator: PropTypes.object.isRequired,
setInsightAPI: PropTypes.func.isRequired
}

function mapStateToProps (state) {
Expand All @@ -186,7 +191,8 @@ function matchDispatchToProps (dispatch) {
setSecretPhrase,
setLanguage,
setCurrency,
setWalletPin
setWalletPin,
setInsightAPI
},
dispatch
)
Expand Down
14 changes: 10 additions & 4 deletions www/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -121624,14 +121624,18 @@ var App = function (_React$Component) {
});
}

// Get settings
// Future: add insight, explorer settings
// Get settings
if (data.settings !== undefined) {
if (data.settings.language !== undefined) {
var settingsLanguage = data.settings.language;
_this2.props.setLanguage(settingsLanguage);
}

if (data.settings.insightAPI !== undefined) {
var _settingsLanguage = data.settings.insightAPI;
_this2.props.setInsightAPI(_settingsLanguage);
}

if (data.settings.currency !== undefined && data.settings.currency !== null) {
var settingsCurrency = data.settings.currency;
_this2.props.setCurrency(settingsCurrency);
Expand Down Expand Up @@ -121709,7 +121713,8 @@ App.propTypes = {
setCurrency: _propTypes2.default.func.isRequired,
setContacts: _propTypes2.default.func.isRequired,
context: _propTypes2.default.object.isRequired,
navigator: _propTypes2.default.object.isRequired
navigator: _propTypes2.default.object.isRequired,
setInsightAPI: _propTypes2.default.func.isRequired
};

function mapStateToProps(state) {
Expand All @@ -121726,7 +121731,8 @@ function matchDispatchToProps(dispatch) {
setSecretPhrase: _Secrets.setSecretPhrase,
setLanguage: _Settings.setLanguage,
setCurrency: _Settings.setCurrency,
setWalletPin: _Settings.setWalletPin
setWalletPin: _Settings.setWalletPin,
setInsightAPI: _Settings.setInsightAPI
}, dispatch);
}

Expand Down
2 changes: 1 addition & 1 deletion www/bundle.js.map

Large diffs are not rendered by default.

0 comments on commit af9e711

Please sign in to comment.