Merge pull request #4126 from BlueWallet/logerror

ADD: Log openURL error
This commit is contained in:
GLaDOS 2021-10-28 21:34:14 +01:00 committed by GitHub
commit b93d304fbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 5 deletions

View File

@ -418,6 +418,7 @@
"eta_3h": "ETA: In ~3 hours",
"eta_1d": "ETA: In ~1 day",
"list_title": "Transactions",
"open_url_error": "Unable to open URL with the default browser. Please change your default browser and try again",
"rbf_explain": "We will replace this transaction with one with a higher fee, so it should be mined faster. This is called RBF—Replace by Fee.",
"rbf_title": "Bump Fee (RBF)",
"status_bump": "Bump Fee",

View File

@ -111,11 +111,24 @@ const TransactionsDetails = () => {
const handleOnOpenTransactionOnBlockExporerTapped = () => {
const url = `https://mempool.space/tx/${tx.hash}`;
Linking.canOpenURL(url).then(supported => {
if (supported) {
Linking.openURL(url);
}
});
Linking.canOpenURL(url)
.then(supported => {
if (supported) {
Linking.openURL(url).catch(e => {
console.log('openURL failed in handleOnOpenTransactionOnBlockExporerTapped');
console.log(e.message);
alert(e.message);
});
} else {
console.log('canOpenURL supported is false in handleOnOpenTransactionOnBlockExporerTapped');
alert(loc.transactions.open_url_error);
}
})
.catch(e => {
console.log('canOpenURL failed in handleOnOpenTransactionOnBlockExporerTapped');
console.log(e.message);
alert(e.message);
});
};
const handleCopyPress = () => {