mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-26 08:55:56 +01:00
REF: wallet export screen
This commit is contained in:
parent
2299f419bd
commit
8724a7ff65
5 changed files with 8 additions and 23 deletions
|
@ -79,8 +79,7 @@ export default class LNDCreateInvoice extends Component {
|
|||
onFailure: () => {
|
||||
this.props.navigation.dismiss();
|
||||
this.props.navigation.navigate('WalletExport', {
|
||||
address: this.state.fromWallet.getAddress(),
|
||||
secret: this.state.fromWallet.getSecret(),
|
||||
wallet: this.state.fromWallet,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
@ -109,8 +109,7 @@ export default class ReceiveDetails extends Component {
|
|||
onFailure: () => {
|
||||
this.props.navigation.goBack();
|
||||
this.props.navigation.navigate('WalletExport', {
|
||||
address: this.wallet.getAddress(),
|
||||
secret: this.wallet.getSecret(),
|
||||
wallet: this.wallet,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
@ -218,8 +218,7 @@ export default class WalletDetails extends Component {
|
|||
<BlueButton
|
||||
onPress={() =>
|
||||
this.props.navigation.navigate('WalletExport', {
|
||||
address: this.state.wallet.getAddress(),
|
||||
secret: this.state.wallet.getSecret(),
|
||||
wallet: this.state.wallet,
|
||||
})
|
||||
}
|
||||
title={loc.wallets.details.export_backup}
|
||||
|
|
|
@ -5,7 +5,7 @@ import { BlueSpacing20, SafeBlueArea, BlueNavigationStyle, BlueText, BlueCopyTex
|
|||
import PropTypes from 'prop-types';
|
||||
import Privacy from '../../Privacy';
|
||||
import Biometric from '../../class/biometrics';
|
||||
import { LightningCustodianWallet } from '../../class';
|
||||
import { LegacyWallet, LightningCustodianWallet, SegwitBech32Wallet, SegwitP2SHWallet } from '../../class';
|
||||
/** @type {AppStorage} */
|
||||
let BlueApp = require('../../BlueApp');
|
||||
let loc = require('../../loc');
|
||||
|
@ -20,17 +20,7 @@ export default class WalletExport extends Component {
|
|||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
let address = props.navigation.state.params.address;
|
||||
let secret = props.navigation.state.params.secret;
|
||||
let wallet;
|
||||
for (let w of BlueApp.getWallets()) {
|
||||
if ((address && w.getAddress() === address) || w.getSecret() === secret) {
|
||||
// found our wallet
|
||||
wallet = w;
|
||||
}
|
||||
}
|
||||
|
||||
let wallet = props.navigation.state.params.wallet;
|
||||
this.state = {
|
||||
isLoading: true,
|
||||
qrCodeHeight: height > width ? width - 40 : width / 2,
|
||||
|
@ -89,7 +79,7 @@ export default class WalletExport extends Component {
|
|||
</View>
|
||||
|
||||
{(() => {
|
||||
if (this.state.wallet.getAddress()) {
|
||||
if ([LegacyWallet.type, SegwitBech32Wallet.type, SegwitP2SHWallet.type].includes(this.state.wallet.type)) {
|
||||
return (
|
||||
<BlueCard>
|
||||
<BlueText>{this.state.wallet.getAddress()}</BlueText>
|
||||
|
@ -125,8 +115,7 @@ WalletExport.propTypes = {
|
|||
navigation: PropTypes.shape({
|
||||
state: PropTypes.shape({
|
||||
params: PropTypes.shape({
|
||||
address: PropTypes.string,
|
||||
secret: PropTypes.string,
|
||||
wallet: PropTypes.object.isRequired,
|
||||
}),
|
||||
}),
|
||||
navigate: PropTypes.func,
|
||||
|
|
|
@ -466,8 +466,7 @@ export default class WalletTransactions extends Component {
|
|||
},
|
||||
onFailure: () =>
|
||||
this.props.navigation.navigate('WalletExport', {
|
||||
address: this.state.wallet.getAddress(),
|
||||
secret: this.state.wallet.getSecret(),
|
||||
wallet: this.state.wallet,
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue