Skip to content

Commit

Permalink
Bugfix: lower priority android crashes (#974)
Browse files Browse the repository at this point in the history
* avoid toNumber

* avoid checking against strings to render
  • Loading branch information
estebanmino authored Aug 9, 2019
1 parent bf319fb commit 71d7a82
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/components/UI/AccountInput/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ class AccountInput extends PureComponent {
onSubmitEditing={this.onFocus}
/>
<View style={styles.ensView}>
{ensRecipient && <Text style={styles.ensAddress}>{renderShortAddress(address)}</Text>}
{!!ensRecipient && <Text style={styles.ensAddress}>{renderShortAddress(address)}</Text>}
</View>
</View>
</View>
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/AccountList/AccountElement/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default class AccountElement extends PureComponent {
{renderFromWei(balance)} {getTicker(ticker)}
</Text>
</View>
{imported && <View style={styles.importedView}>{imported}</View>}
{!!imported && <View style={styles.importedView}>{imported}</View>}
<View style={styles.selectedWrapper}>{selected}</View>
</View>
</TouchableOpacity>
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/AccountSelect/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class AccountSelect extends PureComponent {
{account.name}
</Text>
<Text style={styles.info}>{mainBalance}</Text>
{secondaryBalance && <Text style={styles.info}>{secondaryBalance}</Text>}
{!!secondaryBalance && <Text style={styles.info}>{secondaryBalance}</Text>}
</View>
</TouchableOpacity>
);
Expand Down
4 changes: 2 additions & 2 deletions app/components/UI/CustomGas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class CustomGas extends PureComponent {
ready: false,
advancedCustomGas: false,
customGasPrice: '10',
customGasLimit: this.props.gas.toNumber().toString(),
customGasLimit: fromWei(this.props.gas, 'wei'),
warningGasLimit: '',
warningGasPrice: ''
};
Expand Down Expand Up @@ -203,7 +203,7 @@ class CustomGas extends PureComponent {
break;
}
} else {
this.setState({ customGasLimit: gas.toNumber().toString() });
this.setState({ customGasLimit: fromWei(gas, 'wei') });
this.props.handleGasFeeSelection(gas, apiEstimateModifiedToWEI(customGasPrice));
}
this.setState({ advancedCustomGas: !advancedCustomGas });
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/PaymentRequest/AssetList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default class AssetList extends PureComponent {
<View style={styles.assetIcon}>{this.renderLogo(searchResults[i])}</View>
<View style={styles.assetInfo}>
<Text style={styles.textSymbol}>{symbol}</Text>
{name && <Text style={styles.text}>{name}</Text>}
{!!name && <Text style={styles.text}>{name}</Text>}
</View>
</View>
</StyledButton>
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/SignatureRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class SignatureRequest extends PureComponent {
<WebsiteIcon style={styles.domainLogo} viewStyle={styles.assetLogo} title={title} url={url} />
<Text style={styles.domainTitle}>{title}</Text>
<Text style={styles.domainText}>{url}</Text>
{name && <Text style={styles.domainText}>{name}</Text>}
{!!name && <Text style={styles.domainText}>{name}</Text>}
</View>
);
};
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/TransactionReview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ class TransactionReview extends PureComponent {
<View>
<TransactionReviewSummary actionKey={actionKey} />
<View style={styles.reviewForm}>{this.renderTransactionDetails()}</View>
{error && <Text style={styles.error}>{error}</Text>}
{!!error && <Text style={styles.error}>{error}</Text>}
</View>
</ActionView>
</View>
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/ChoosePassword/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ class ChoosePassword extends PureComponent {

{this.renderSwitch()}

{this.state.error && <Text style={styles.errorMsg}>{this.state.error}</Text>}
{!!this.state.error && <Text style={styles.errorMsg}>{this.state.error}</Text>}
</View>
</KeyboardAwareScrollView>
<View style={styles.ctaWrapper}>
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/ChoosePasswordSimple/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ class ChoosePasswordSimple extends PureComponent {
</Text>
</View>

{this.state.error && <Text style={styles.errorMsg}>{this.state.error}</Text>}
{!!this.state.error && <Text style={styles.errorMsg}>{this.state.error}</Text>}
</View>
</KeyboardAwareScrollView>
<View style={styles.ctaWrapper}>
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/ImportFromSeed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ class ImportFromSeed extends PureComponent {

{this.renderSwitch()}

{this.state.error && <Text style={styles.errorMsg}>{this.state.error}</Text>}
{!!this.state.error && <Text style={styles.errorMsg}>{this.state.error}</Text>}

<View style={styles.ctaWrapper}>
<StyledButton
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/Login/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ class Login extends PureComponent {

{this.renderSwitch()}

{this.state.error && <Text style={styles.errorMsg}>{this.state.error}</Text>}
{!!this.state.error && <Text style={styles.errorMsg}>{this.state.error}</Text>}

<View style={styles.ctaWrapper}>
<StyledButton type={'confirm'} onPress={this.onLogin}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ class Deposit extends PureComponent {

<Text style={styles.fiatValue}>{conversionAmount}</Text>
{this.renderMinimumsOrSpinner()}
{error && <Text style={styles.invalidAmountError}>{error}</Text>}
{!!error && <Text style={styles.invalidAmountError}>{error}</Text>}

<KeyboardAvoidingView
style={styles.buttonsWrapper}
Expand Down

0 comments on commit 71d7a82

Please sign in to comment.