FIX: android build

This commit is contained in:
Overtorment 2019-05-03 13:36:11 +01:00
parent 54034fb722
commit 9bed2c3776
15 changed files with 30 additions and 30 deletions

2
App.js
View File

@ -195,7 +195,7 @@ export default class App extends React.Component {
renderClipboardContentModal = () => {
return (
<Modal
onModalShow={() => ReactNativeHapticFeedback.trigger('impactLight', false)}
onModalShow={() => ReactNativeHapticFeedback.trigger('impactLight', { ignoreAndroidSystemSettings: false })}
isVisible={this.state.isClipboardContentModalVisible}
style={styles.bottomModal}
onBackdropPress={() => {

6
package-lock.json generated
View File

@ -3030,9 +3030,9 @@
}
},
"@react-native-community/slider": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@react-native-community/slider/-/slider-1.1.0.tgz",
"integrity": "sha512-73kn+OaPJ4e5gvxlG97GLSmCzUq/twQHfvqA+/6OjKfScOtPCs4em8e4V0mn2hSje/PNLtSqnjzNUNviB4f0+w=="
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@react-native-community/slider/-/slider-1.0.4.tgz",
"integrity": "sha512-L02BSwDTHGc5BPrtllMTOKSKg9QyJbz001pIkD2FGmUFA9Nfvs0cne36N4nnrR5jQhSzwnmnQpzXkQ/yzQxwMg=="
},
"@react-navigation/core": {
"version": "3.4.1",

View File

@ -42,7 +42,7 @@
"dependencies": {
"@babel/preset-env": "7.4.4",
"@react-native-community/async-storage": "1.3.3",
"@react-native-community/slider": "1.1.0",
"@react-native-community/slider": "1.0.4",
"@remobile/react-native-qrcode-local-image": "1.0.4",
"bignumber.js": "8.1.1",
"bip21": "2.0.2",

View File

@ -31,14 +31,14 @@ export default class LNDCreateInvoice extends Component {
try {
const invoiceRequest = await this.state.fromWallet.addInvoice(this.state.amount, this.state.description);
EV(EV.enum.TRANSACTIONS_COUNT_CHANGED);
ReactNativeHapticFeedback.trigger('notificationSuccess', false);
ReactNativeHapticFeedback.trigger('notificationSuccess', { ignoreAndroidSystemSettings: false });
this.props.navigation.navigate('LNDViewInvoice', {
invoice: invoiceRequest,
fromWallet: this.state.fromWallet,
isModal: true,
});
} catch (_error) {
ReactNativeHapticFeedback.trigger('notificationError', false);
ReactNativeHapticFeedback.trigger('notificationError', { ignoreAndroidSystemSettings: false });
this.setState({ isLoading: false });
alert('Error');
}

View File

@ -64,7 +64,7 @@ export default class LNDViewInvoice extends Component {
if (updatedUserInvoice.ispaid) {
// we fetched the invoice, and it is paid :-)
this.setState({ isFetchingInvoices: false });
ReactNativeHapticFeedback.trigger('notificationSuccess', false);
ReactNativeHapticFeedback.trigger('notificationSuccess', { ignoreAndroidSystemSettings: false });
clearInterval(this.fetchInvoiceInterval);
this.fetchInvoiceInterval = undefined;
EV(EV.enum.REMOTE_TRANSACTIONS_COUNT_CHANGED); // remote because we want to refetch from server tx list and balance
@ -75,7 +75,7 @@ export default class LNDViewInvoice extends Component {
if (invoiceExpiration < now && !updatedUserInvoice.ispaid) {
// invoice expired :-(
this.setState({ isFetchingInvoices: false });
ReactNativeHapticFeedback.trigger('notificationError', false);
ReactNativeHapticFeedback.trigger('notificationError', { ignoreAndroidSystemSettings: false });
clearInterval(this.fetchInvoiceInterval);
this.fetchInvoiceInterval = undefined;
EV(EV.enum.TRANSACTIONS_COUNT_CHANGED);

View File

@ -38,7 +38,7 @@ export default class ScanLndInvoice extends React.Component {
super(props);
if (!BlueApp.getWallets().some(item => item.type === LightningCustodianWallet.type)) {
ReactNativeHapticFeedback.trigger('notificationError', false);
ReactNativeHapticFeedback.trigger('notificationError', { ignoreAndroidSystemSettings: false });
alert('Before paying a Lightning invoice, you must first add a Lightning wallet.');
props.navigation.dismiss();
} else {
@ -93,7 +93,7 @@ export default class ScanLndInvoice extends React.Component {
processInvoice = data => {
this.setState({ isLoading: true }, async () => {
if (!this.state.fromWallet) {
ReactNativeHapticFeedback.trigger('notificationError', false);
ReactNativeHapticFeedback.trigger('notificationError', { ignoreAndroidSystemSettings: false });
alert('Before paying a Lightning invoice, you must first add a Lightning wallet.');
return this.props.navigation.goBack();
}
@ -133,7 +133,7 @@ export default class ScanLndInvoice extends React.Component {
} catch (Err) {
Keyboard.dismiss();
this.setState({ isLoading: false });
ReactNativeHapticFeedback.trigger('notificationError', false);
ReactNativeHapticFeedback.trigger('notificationError', { ignoreAndroidSystemSettings: false });
alert(Err.message);
}
});
@ -157,14 +157,14 @@ export default class ScanLndInvoice extends React.Component {
let expiresIn = (decoded.timestamp * 1 + decoded.expiry * 1) * 1000; // ms
if (+new Date() > expiresIn) {
this.setState({ isLoading: false });
ReactNativeHapticFeedback.trigger('notificationError', false);
ReactNativeHapticFeedback.trigger('notificationError', { ignoreAndroidSystemSettings: false });
return alert('Invoice expired');
}
const currentUserInvoices = fromWallet.user_invoices_raw; // not fetching invoices, as we assume they were loaded previously
if (currentUserInvoices.some(invoice => invoice.payment_hash === decoded.payment_hash)) {
this.setState({ isLoading: false });
ReactNativeHapticFeedback.trigger('notificationError', false);
ReactNativeHapticFeedback.trigger('notificationError', { ignoreAndroidSystemSettings: false });
return alert(loc.lnd.sameWalletAsInvoiceError);
}
@ -173,7 +173,7 @@ export default class ScanLndInvoice extends React.Component {
} catch (Err) {
console.log(Err.message);
this.setState({ isLoading: false });
ReactNativeHapticFeedback.trigger('notificationError', false);
ReactNativeHapticFeedback.trigger('notificationError', { ignoreAndroidSystemSettings: false });
return alert(Err.message);
}

View File

@ -59,7 +59,7 @@ export default class Confirm extends Component {
});
}
} catch (error) {
ReactNativeHapticFeedback.trigger('notificationError', false);
ReactNativeHapticFeedback.trigger('notificationError', { ignoreAndroidSystemSettings: false });
this.setState({ isLoading: false });
alert(error.message);
}

View File

@ -347,7 +347,7 @@ export default class SendDetails extends Component {
if (error) {
this.setState({ isLoading: false });
alert(error);
ReactNativeHapticFeedback.trigger('notificationError', false);
ReactNativeHapticFeedback.trigger('notificationError', { ignoreAndroidSystemSettings: false });
return;
}
@ -411,7 +411,7 @@ export default class SendDetails extends Component {
await BlueApp.saveToDisk();
} catch (err) {
console.log(err);
ReactNativeHapticFeedback.trigger('notificationError', false);
ReactNativeHapticFeedback.trigger('notificationError', { ignoreAndroidSystemSettings: false });
alert(err);
this.setState({ isLoading: false });
return;

View File

@ -26,7 +26,7 @@ export default class Success extends Component {
async componentDidMount() {
console.log('send/create - componentDidMount');
ReactNativeHapticFeedback.trigger('notificationSuccess', false);
ReactNativeHapticFeedback.trigger('notificationSuccess', { ignoreAndroidSystemSettings: false });
}
render() {

View File

@ -215,7 +215,7 @@ export default class WalletsAdd extends Component {
await BlueApp.saveToDisk();
EV(EV.enum.WALLETS_COUNT_CHANGED);
A(A.ENUM.CREATED_WALLET);
ReactNativeHapticFeedback.trigger('notificationSuccess', false);
ReactNativeHapticFeedback.trigger('notificationSuccess', { ignoreAndroidSystemSettings: false });
this.props.navigation.dismiss();
};
@ -260,7 +260,7 @@ export default class WalletsAdd extends Component {
await BlueApp.saveToDisk();
EV(EV.enum.WALLETS_COUNT_CHANGED);
A(A.ENUM.CREATED_WALLET);
ReactNativeHapticFeedback.trigger('notificationSuccess', false);
ReactNativeHapticFeedback.trigger('notificationSuccess', { ignoreAndroidSystemSettings: false });
if (w.type === HDSegwitP2SHWallet.type) {
this.props.navigation.navigate('PleaseBackup', {
secret: w.getSecret(),

View File

@ -180,7 +180,7 @@ export default class WalletDetails extends Component {
<TouchableOpacity
style={{ alignItems: 'center' }}
onPress={() => {
ReactNativeHapticFeedback.trigger('notificationWarning', false);
ReactNativeHapticFeedback.trigger('notificationWarning', { ignoreAndroidSystemSettings: false });
Alert.alert(
loc.wallets.details.delete + ' ' + loc.wallets.details.title,
loc.wallets.details.are_you_sure,
@ -191,7 +191,7 @@ export default class WalletDetails extends Component {
this.props.navigation.setParams({ isLoading: true });
this.setState({ isLoading: true }, async () => {
BlueApp.deleteWallet(this.state.wallet);
ReactNativeHapticFeedback.trigger('notificationSuccess', false);
ReactNativeHapticFeedback.trigger('notificationSuccess', { ignoreAndroidSystemSettings: false });
await BlueApp.saveToDisk();
EV(EV.enum.TRANSACTIONS_COUNT_CHANGED);
EV(EV.enum.WALLETS_COUNT_CHANGED);

View File

@ -60,7 +60,7 @@ export default class WalletsImport extends Component {
alert('This wallet has been previously imported.');
} else {
alert(loc.wallets.import.success);
ReactNativeHapticFeedback.trigger('notificationSuccess', false);
ReactNativeHapticFeedback.trigger('notificationSuccess', { ignoreAndroidSystemSettings: false });
w.setLabel(loc.wallets.import.imported + ' ' + w.typeReadable);
BlueApp.wallets.push(w);
await BlueApp.saveToDisk();
@ -189,7 +189,7 @@ export default class WalletsImport extends Component {
}
alert(loc.wallets.import.error);
ReactNativeHapticFeedback.trigger('notificationError', false);
ReactNativeHapticFeedback.trigger('notificationError', { ignoreAndroidSystemSettings: false });
// Plan:
// 1. check if its HDSegwitP2SHWallet (BIP49)
// 2. check if its HDLegacyP2PKHWallet (BIP44)

View File

@ -232,7 +232,7 @@ export default class WalletsList extends Component {
if (BlueApp.getWallets().length > 1) {
this.props.navigation.navigate('ReorderWallets');
} else {
ReactNativeHapticFeedback.trigger('notificationError', false);
ReactNativeHapticFeedback.trigger('notificationError', { ignoreAndroidSystemSettings: false });
}
};

View File

@ -161,14 +161,14 @@ export default class ReorderWallets extends Component {
data={this.state.data}
renderRow={this._renderItem}
onChangeOrder={() => {
ReactNativeHapticFeedback.trigger('impactMedium', false);
ReactNativeHapticFeedback.trigger('impactMedium', { ignoreAndroidSystemSettings: false });
this.setState({ hasMovedARow: true });
}}
onActivateRow={() => {
ReactNativeHapticFeedback.trigger('selection', false);
ReactNativeHapticFeedback.trigger('selection', { ignoreAndroidSystemSettings: false });
}}
onReleaseRow={() => {
ReactNativeHapticFeedback.trigger('impactLight', false);
ReactNativeHapticFeedback.trigger('impactLight', { ignoreAndroidSystemSettings: false });
}}
/>
</SafeBlueArea>

View File

@ -36,7 +36,7 @@ export default class SelectWallet extends Component {
return (
<TouchableOpacity
onPress={() => {
ReactNativeHapticFeedback.trigger('selection', false);
ReactNativeHapticFeedback.trigger('selection', { ignoreAndroidSystemSettings: false });
this.props.navigation.getParam('onWalletSelect')(item);
}}
>