Skip to content

Commit

Permalink
Spark: fix address generation
Browse files Browse the repository at this point in the history
  • Loading branch information
kaloudis committed May 20, 2022
1 parent dcc1e72 commit 732ce00
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 27 deletions.
3 changes: 2 additions & 1 deletion stores/InvoicesStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ export default class InvoicesStore {
@action
public getNewAddress = () => {
return RESTUtils.getNewAddress().then((data: any) => {
this.onChainAddress = data.address || data[0].address;
this.onChainAddress =
data.address || data.bech32 || data[0].address;
});
};

Expand Down
39 changes: 13 additions & 26 deletions views/Wallet/MainPane.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Image, StyleSheet, Text, View, TouchableOpacity } from 'react-native';
import { Image, Text, View, TouchableOpacity } from 'react-native';
import { Badge } from 'react-native-elements';
import { inject, observer } from 'mobx-react';
import Button from '../../components/Button';
Expand Down Expand Up @@ -90,7 +90,7 @@ export default class MainPane extends React.PureComponent<MainPaneProps, {}> {
}

const NetworkBadge = () => (
<View style={styles.nodeInfo}>
<>
{nodeAddress && nodeAddress.includes('.onion') ? (
<TouchableOpacity
onPress={() => navigation.navigate('NodeInfo')}
Expand All @@ -101,18 +101,18 @@ export default class MainPane extends React.PureComponent<MainPaneProps, {}> {
/>
</TouchableOpacity>
) : null}
{nodeAddress && !nodeAddress.includes('.onion') ? (
{infoValue !== 'ⓘ' ? (
<Badge
onPress={() => navigation.navigate('NodeInfo')}
value={infoValue}
badgeStyle={{
backgroundColor: 'gray',
borderWidth: 0,
marginLeft: 5
marginTop: 5
}}
/>
) : null}
</View>
</>
);

let mainPane;
Expand All @@ -136,16 +136,14 @@ export default class MainPane extends React.PureComponent<MainPaneProps, {}> {
) : (
<BalanceViewCombined />
)}
{infoValue !== 'ⓘ' && (
<View
style={{
marginTop: 5,
alignItems: 'center'
}}
>
<NetworkBadge />
</View>
)}
<View
style={{
marginTop: 5,
alignItems: 'center'
}}
>
<NetworkBadge />
</View>
</View>
</View>
);
Expand Down Expand Up @@ -209,14 +207,3 @@ export default class MainPane extends React.PureComponent<MainPaneProps, {}> {
return <React.Fragment>{mainPane}</React.Fragment>;
}
}

const styles = StyleSheet.create({
loadingContainer: {
height: 220,
paddingLeft: 10
},
nodeInfo: {
alignItems: 'flex-start',
marginLeft: -15
}
});

0 comments on commit 732ce00

Please sign in to comment.