Skip to content
This repository has been archived by the owner on Oct 26, 2021. It is now read-only.

Commit

Permalink
Merge pull request #312 from balance-io/develop
Browse files Browse the repository at this point in the history
Deploy v0.3.0 (10) [Master]
  • Loading branch information
jinchung authored Jan 21, 2019
2 parents d17ea1b + d32a5fe commit 718dcdc
Show file tree
Hide file tree
Showing 13 changed files with 85 additions and 160 deletions.
4 changes: 3 additions & 1 deletion ios/BalanceWallet/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>4</string>
<string>10</string>
<key>CodePushDeploymentKey</key>
<string>$(CODEPUSH_KEY)</string>
<key>ITSAppUsesNonExemptEncryption</key>
Expand Down Expand Up @@ -51,6 +51,8 @@
<string>Used to sign transactions</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Balance Wallet</string>
<key>NSMicrophoneUsageDescription</key>
<string>Balance Wallet</string>
<key>NSMotionUsageDescription</key>
<string>Balance Wallet</string>
<key>NSSpeechRecognitionUsageDescription</key>
Expand Down
18 changes: 9 additions & 9 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ PODS:
- GoogleToolboxForMac/Logger (~> 2.1)
- Protobuf (~> 3.1)
- FLAnimatedImage (1.0.12)
- GoogleToolboxForMac/Defines (2.1.4)
- GoogleToolboxForMac/Logger (2.1.4):
- GoogleToolboxForMac/Defines (= 2.1.4)
- "GoogleToolboxForMac/NSData+zlib (2.1.4)":
- GoogleToolboxForMac/Defines (= 2.1.4)
- GoogleToolboxForMac/Defines (2.2.0)
- GoogleToolboxForMac/Logger (2.2.0):
- GoogleToolboxForMac/Defines (= 2.2.0)
- "GoogleToolboxForMac/NSData+zlib (2.2.0)":
- GoogleToolboxForMac/Defines (= 2.2.0)
- nanopb (0.3.901):
- nanopb/decode (= 0.3.901)
- nanopb/encode (= 0.3.901)
Expand All @@ -56,8 +56,8 @@ PODS:
- React
- RNReanimated (1.0.0-alpha.11):
- React
- SDWebImage/Core (4.4.2)
- SDWebImage/GIF (4.4.2):
- SDWebImage/Core (4.4.3)
- SDWebImage/GIF (4.4.3):
- FLAnimatedImage (~> 1.0)
- SDWebImage/Core
- yoga (0.57.1.React)
Expand Down Expand Up @@ -112,15 +112,15 @@ SPEC CHECKSUMS:
FirebaseInstanceID: 4f7768a98c5c3c5bd9a4c9e431ea98dccc0a51f9
FirebaseMessaging: 94579ae655d817287f029ebfebd5b0811fbb3a51
FLAnimatedImage: 4a0b56255d9b05f18b6dd7ee06871be5d3b89e31
GoogleToolboxForMac: 91c824d21e85b31c2aae9bb011c5027c9b4e738f
GoogleToolboxForMac: ff31605b7d66400dcec09bed5861689aebadda4d
nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48
Protobuf: 6b0fc34ab8f2b7dbad2278a48be08a669427c59f
React: 1fe0eb13d90b625d94c3b117c274dcfd2e760e11
react-native-blur: c35c1f6c2c76db7108bde7ed343bd2b01d64e0c0
react-native-fast-image: cba3d9bf9c2cf8ddb643d887a686c53a5dd90a2c
RNLanguages: e3ae05ef105937645218272429dac0c3f7633451
RNReanimated: 45d9313b7a62318ed00d60a811937321e43e076e
SDWebImage: 4170dae6332a915d44c918675d51dc1c4c06b45f
SDWebImage: c5594f1a19c48d526d321e548902b56b479cd508
yoga: b1ce48b6cf950b98deae82838f5173ea7cf89e85

PODFILE CHECKSUM: 49f66978b10019df5c3f0971f9cb6e6bc610c256
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "BalanceWallet",
"version": "0.3.0-4",
"version": "0.3.0-10",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
Expand All @@ -18,7 +18,7 @@
"@tradle/react-native-http": "^2.0.0",
"assert": "^1.4.1",
"axios": "^0.18.0",
"balance-common": "^0.6.15",
"balance-common": "^0.6.19",
"browserify-zlib": "^0.1.4",
"buffer": "^4.9.1",
"chroma-js": "^1.3.7",
Expand Down
34 changes: 19 additions & 15 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
import {
accountLoadState,
commonStorage,
settingsInitializeState,
settingsUpdateAccountAddress,
} from 'balance-common';
import { get, isEmpty } from 'lodash';
import CodePush from 'react-native-code-push';
import firebase from 'react-native-firebase';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { commonStorage, settingsInitializeState, settingsUpdateAccountAddress } from 'balance-common';
import { AppRegistry, AlertIOS, AppState } from 'react-native';
import { compose, withProps } from 'recompact';
import { connect, Provider } from 'react-redux';
import { StackActions } from 'react-navigation';
import Piwik from 'react-native-matomo';
import {
AppRegistry,
AlertIOS,
AppState
} from 'react-native';
import { StackActions } from 'react-navigation';
import CodePush from 'react-native-code-push';
import firebase from 'react-native-firebase';
import { connect, Provider } from 'react-redux';
import { compose, withProps } from 'recompact';
import { FlexItem } from './components/layout';
import OfflineBadge from './components/OfflineBadge';
import {
Expand Down Expand Up @@ -39,6 +48,7 @@ if (process.env.NODE_ENV === 'development') {

class App extends Component {
static propTypes = {
accountLoadState: PropTypes.func,
addTransactionsToApprove: PropTypes.func,
addTransactionToApprove: PropTypes.func,
getValidWalletConnectors: PropTypes.func,
Expand All @@ -62,23 +72,18 @@ class App extends Component {
firebase.messaging().getToken()
.then(fcmToken => {
if (fcmToken) {
console.log('received fcmToken', fcmToken);
commonStorage.saveLocal('balanceWalletFcmToken', { data: fcmToken });
} else {
console.log('no fcm token yet');
}
})
.catch(error => {
console.log('error getting fcm token');
});

this.onTokenRefreshListener = firebase.messaging().onTokenRefresh(fcmToken => {
console.log('received refreshed fcm token', fcmToken);
commonStorage.saveLocal('balanceWalletFcmToken', { data: fcmToken });
});

this.notificationListener = firebase.notifications().onNotification(notification => {
console.log('on notification received while app in foreground');
const navState = get(this.navigatorRef, 'state.nav');
const route = Navigation.getActiveRouteName(navState);
const { callId, sessionId } = notification.data;
Expand All @@ -98,7 +103,6 @@ class App extends Component {
});

this.notificationOpenedListener = firebase.notifications().onNotificationOpened(notificationOpen => {
console.log('on notification manually opened');
const { callId, sessionId } = notificationOpen.notification.data;
this.onPushNotificationOpened(callId, sessionId, false);
});
Expand All @@ -108,9 +112,9 @@ class App extends Component {
try {
this.props.trackingDateInit();
const walletAddress = await walletInit(seedPhrase);
console.log('wallet address is', walletAddress);
this.props.settingsInitializeState();
this.props.settingsUpdateAccountAddress(walletAddress, 'BALANCEWALLET');
this.props.accountLoadState();
await this.props.refreshAccount();
this.props.transactionsToApproveInit();
try {
Expand All @@ -127,7 +131,6 @@ class App extends Component {
}
return walletAddress;
} catch (error) {
console.log('WALLET ERROR', error);
return AlertIOS.alert('Error: Failed to initialize wallet.');
}
};
Expand Down Expand Up @@ -213,6 +216,7 @@ const AppWithRedux = compose(
connect(
null,
{
accountLoadState,
addTransactionsToApprove,
addTransactionToApprove,
settingsInitializeState,
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppVersionStamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ const Container = styled(Monospace).attrs({
text-align: center;
`;

const AppVersionStamp = props => <Container {...props}>Balance v0.3.0 (4)</Container>;
const AppVersionStamp = props => <Container {...props}>Balance v0.3.0 (10)</Container>;

export default AppVersionStamp;
2 changes: 1 addition & 1 deletion src/components/asset-list/AssetList.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const AssetList = ({
sections,
...props
}) => (
(isLoading || isEmpty) ? (
((isLoading && isEmpty) || isEmpty) ? (
<AssetListSkeleton isLoading={isLoading} />
) : (
<SectionList
Expand Down
1 change: 1 addition & 0 deletions src/components/qrcode-scanner/QRCodeScanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class QRCodeScanner extends PureComponent {
<ReactNativeQRCodeScanner
bottomViewStyle={styles.disableSection}
cameraProps={{
captureAudio: false,
onCameraReady: this.handleCameraReady,
onMountError: this.handleMountError,
}}
Expand Down
2 changes: 1 addition & 1 deletion src/components/settings-menu/SettingsSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { Emoji, Text } from '../text';

const SettingsExternalURLs = {
about: 'https://balance.io/about',
feedback: 'https://support@balance.io',
feedback: 'http://support.balance.io',
legal: 'https://github.com/balance-io/balance-wallet/blob/master/LICENSE',
};

Expand Down
1 change: 0 additions & 1 deletion src/helpers/buildWalletSections.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const buildWalletSections = (
showShitcoins,
uniqueTokens,
) => {
console.log('build wallet sections');
const sections = {
balances: {
data: showShitcoins ? allAssets : assets,
Expand Down
9 changes: 7 additions & 2 deletions src/hoc/withAccountRefresh.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { AlertIOS } from 'react-native';
import { assetsRefreshState, transactionsRefreshState } from 'balance-common';
import { connect } from 'react-redux';
import { compose, withHandlers } from 'recompact';
Expand All @@ -6,8 +7,12 @@ export default Component => compose(
connect(null, { assetsRefreshState, transactionsRefreshState }),
withHandlers({
refreshAccount: (ownProps) => async () => {
ownProps.transactionsRefreshState();
await ownProps.assetsRefreshState();
try {
ownProps.transactionsRefreshState();
await ownProps.assetsRefreshState();
} catch (error) {
// TODO more granular error messaging depending on offline status
}
},
}),
)(Component);
5 changes: 0 additions & 5 deletions src/model/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ export const loadWallet = async () => {
if (privateKey) {
const wallet = new ethers.Wallet(privateKey);
wallet.provider = ethers.providers.getDefaultProvider();
console.log(`Wallet: successfully loaded existing wallet with public address: ${wallet.address}`);
return wallet;
}
console.log("Wallet: failed to load existing wallet because the private key doesn't exist");
return null;
};

Expand All @@ -61,7 +59,6 @@ export const sendTransaction = async ({ tracking, transaction }) => {
Piwik.trackEvent('Send', tracking.action, tracking.name, tracking.amount);
return result.hash;
} catch (error) {
console.log('sendTxn error', error);
AlertIOS.alert(lang.t('wallet.transaction.alert.failed_transaction'));
return null;
}
Expand All @@ -77,7 +74,6 @@ export const signMessage = async (message, authenticationPrompt = lang.t('wallet
try {
return await wallet.signMessage(message);
} catch (error) {
console.log('signMessage error', error);
AlertIOS.alert(lang.t('wallet.message_signing.failed_signing'));
return null;
}
Expand Down Expand Up @@ -116,7 +112,6 @@ const saveWalletDetails = async (seedPhrase, privateKey, address) => {
saveSeedPhrase(seedPhrase, accessControlOptions);
savePrivateKey(privateKey, accessControlOptions);
saveAddress(address);
console.log(`Wallet: Generated wallet with public address: ${address}`);
};

const saveSeedPhrase = async (seedPhrase, accessControlOptions = {}) => {
Expand Down
2 changes: 1 addition & 1 deletion src/screens/WalletScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default compose(
withIsWalletEmpty,
withState('showShitcoins', 'toggleShowShitcoins', true),
withHandlers({
onRefreshList: ({ refreshAccount }) => () => refreshAccount(),
onRefreshList: ({ refreshAccount }) => async () => await refreshAccount(),
onToggleShowShitcoins: ({ showShitcoins, toggleShowShitcoins }) => (index) => {
if (index === 0) {
const updatedShowShitcoinsSetting = !showShitcoins;
Expand Down
Loading

0 comments on commit 718dcdc

Please sign in to comment.