mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 01:40:12 +01:00
FIX: Save unit change fixed
This commit is contained in:
parent
1a4f820c63
commit
a5455d2549
@ -163,10 +163,11 @@ export class LightningButton extends Component {
|
|||||||
export class BlueWalletNavigationHeader extends Component {
|
export class BlueWalletNavigationHeader extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
wallet: PropTypes.shape().isRequired,
|
wallet: PropTypes.shape().isRequired,
|
||||||
|
onWalletUnitChange: PropTypes.func,
|
||||||
};
|
};
|
||||||
|
|
||||||
static getDerivedStateFromProps(props, _state) {
|
static getDerivedStateFromProps(props, _state) {
|
||||||
return { wallet: props.wallet };
|
return { wallet: props.wallet, onWalletUnitChange: props.onWalletUnitChange };
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@ -230,7 +231,9 @@ export class BlueWalletNavigationHeader extends Component {
|
|||||||
walletPreviousPreferredUnit = BitcoinUnit.BTC;
|
walletPreviousPreferredUnit = BitcoinUnit.BTC;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({ wallet, walletPreviousPreferredUnit: walletPreviousPreferredUnit });
|
this.setState({ wallet, walletPreviousPreferredUnit: walletPreviousPreferredUnit }, () => {
|
||||||
|
this.props.onWalletUnitChange(wallet);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@ -241,8 +244,7 @@ export class BlueWalletNavigationHeader extends Component {
|
|||||||
>
|
>
|
||||||
<Image
|
<Image
|
||||||
source={
|
source={
|
||||||
(LightningCustodianWallet.type === this.state.wallet.type && require('./img/lnd-shape.png')) ||
|
(LightningCustodianWallet.type === this.state.wallet.type && require('./img/lnd-shape.png')) || require('./img/btc-shape.png')
|
||||||
require('./img/btc-shape.png')
|
|
||||||
}
|
}
|
||||||
style={{
|
style={{
|
||||||
width: 99,
|
width: 99,
|
||||||
|
10
analytics.js
10
analytics.js
@ -5,9 +5,13 @@ amplitude.getInstance().init('8b7cf19e8eea3cdcf16340f5fbf16330', null, {
|
|||||||
useNativeDeviceInfo: true,
|
useNativeDeviceInfo: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
let A = event => {
|
let A = async event => {
|
||||||
amplitude.getInstance().logEvent(event);
|
amplitude.getInstance().logEvent(event, {});
|
||||||
Analytics.trackEvent(event);
|
try {
|
||||||
|
Analytics.trackEvent(event);
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
A.ENUM = {
|
A.ENUM = {
|
||||||
|
@ -204,7 +204,6 @@ export default class WalletTransactions extends Component {
|
|||||||
|
|
||||||
async onWillBlur() {
|
async onWillBlur() {
|
||||||
StatusBar.setBarStyle('dark-content');
|
StatusBar.setBarStyle('dark-content');
|
||||||
await BlueApp.saveToDisk();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
@ -227,7 +226,14 @@ export default class WalletTransactions extends Component {
|
|||||||
onWillBlur={() => this.onWillBlur()}
|
onWillBlur={() => this.onWillBlur()}
|
||||||
onDidFocus={() => this.props.navigation.setParams({ isLoading: false })}
|
onDidFocus={() => this.props.navigation.setParams({ isLoading: false })}
|
||||||
/>
|
/>
|
||||||
<BlueWalletNavigationHeader wallet={this.state.wallet} />
|
<BlueWalletNavigationHeader
|
||||||
|
wallet={this.state.wallet}
|
||||||
|
onWalletUnitChange={wallet =>
|
||||||
|
InteractionManager.runAfterInteractions(async () => {
|
||||||
|
this.setState({ wallet }, () => BlueApp.saveToDisk());
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/>
|
||||||
<View style={{ flex: 1, backgroundColor: '#FFFFFF' }}>
|
<View style={{ flex: 1, backgroundColor: '#FFFFFF' }}>
|
||||||
{this.state.wallet.type === LightningCustodianWallet.type && (
|
{this.state.wallet.type === LightningCustodianWallet.type && (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
|
Loading…
Reference in New Issue
Block a user