mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-23 23:27:26 +01:00
FIX: incorrect error handling when scanning invalid BC-UR data
This commit is contained in:
parent
6c87d23d05
commit
9a26be1c80
1 changed files with 28 additions and 16 deletions
|
@ -156,16 +156,20 @@ const ScanQRCode = () => {
|
|||
} catch (error) {
|
||||
console.warn(error);
|
||||
setIsLoading(true);
|
||||
Alert.alert(loc.send.scan_error, loc._.invalid_animated_qr_code_fragment, [
|
||||
{
|
||||
text: loc._.ok,
|
||||
onPress: () => {
|
||||
setIsLoading(false);
|
||||
Alert.alert(
|
||||
loc.send.scan_error,
|
||||
loc._.invalid_animated_qr_code_fragment,
|
||||
[
|
||||
{
|
||||
text: loc._.ok,
|
||||
onPress: () => {
|
||||
setIsLoading(false);
|
||||
},
|
||||
style: 'default',
|
||||
},
|
||||
style: 'default',
|
||||
},
|
||||
],
|
||||
{ cancelabe: false },
|
||||
]);
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -200,16 +204,20 @@ const ScanQRCode = () => {
|
|||
} catch (error) {
|
||||
console.warn(error);
|
||||
setIsLoading(true);
|
||||
Alert.alert(loc.send.scan_error, loc._.invalid_animated_qr_code_fragment, [
|
||||
{
|
||||
text: loc._.ok,
|
||||
onPress: () => {
|
||||
setIsLoading(false);
|
||||
Alert.alert(
|
||||
loc.send.scan_error,
|
||||
loc._.invalid_animated_qr_code_fragment,
|
||||
[
|
||||
{
|
||||
text: loc._.ok,
|
||||
onPress: () => {
|
||||
setIsLoading(false);
|
||||
},
|
||||
style: 'default',
|
||||
},
|
||||
style: 'default',
|
||||
},
|
||||
],
|
||||
{ cancelabe: false },
|
||||
]);
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -229,6 +237,10 @@ const ScanQRCode = () => {
|
|||
return _onReadUniformResourceV2(ret.data);
|
||||
}
|
||||
|
||||
if (ret.data.toUpperCase().startsWith('UR:CRYPTO-OUTPUT')) {
|
||||
return _onReadUniformResourceV2(ret.data);
|
||||
}
|
||||
|
||||
if (ret.data.toUpperCase().startsWith('UR:BYTES')) {
|
||||
const splitted = ret.data.split('/');
|
||||
if (splitted.length === 3 && splitted[1].includes('-')) {
|
||||
|
|
Loading…
Add table
Reference in a new issue