mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-24 15:36:59 +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,7 +156,10 @@ const ScanQRCode = () => {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn(error);
|
console.warn(error);
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
Alert.alert(loc.send.scan_error, loc._.invalid_animated_qr_code_fragment, [
|
Alert.alert(
|
||||||
|
loc.send.scan_error,
|
||||||
|
loc._.invalid_animated_qr_code_fragment,
|
||||||
|
[
|
||||||
{
|
{
|
||||||
text: loc._.ok,
|
text: loc._.ok,
|
||||||
onPress: () => {
|
onPress: () => {
|
||||||
|
@ -164,8 +167,9 @@ const ScanQRCode = () => {
|
||||||
},
|
},
|
||||||
style: 'default',
|
style: 'default',
|
||||||
},
|
},
|
||||||
|
],
|
||||||
{ cancelabe: false },
|
{ cancelabe: false },
|
||||||
]);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -200,7 +204,10 @@ const ScanQRCode = () => {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn(error);
|
console.warn(error);
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
Alert.alert(loc.send.scan_error, loc._.invalid_animated_qr_code_fragment, [
|
Alert.alert(
|
||||||
|
loc.send.scan_error,
|
||||||
|
loc._.invalid_animated_qr_code_fragment,
|
||||||
|
[
|
||||||
{
|
{
|
||||||
text: loc._.ok,
|
text: loc._.ok,
|
||||||
onPress: () => {
|
onPress: () => {
|
||||||
|
@ -208,8 +215,9 @@ const ScanQRCode = () => {
|
||||||
},
|
},
|
||||||
style: 'default',
|
style: 'default',
|
||||||
},
|
},
|
||||||
|
],
|
||||||
{ cancelabe: false },
|
{ cancelabe: false },
|
||||||
]);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -229,6 +237,10 @@ const ScanQRCode = () => {
|
||||||
return _onReadUniformResourceV2(ret.data);
|
return _onReadUniformResourceV2(ret.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ret.data.toUpperCase().startsWith('UR:CRYPTO-OUTPUT')) {
|
||||||
|
return _onReadUniformResourceV2(ret.data);
|
||||||
|
}
|
||||||
|
|
||||||
if (ret.data.toUpperCase().startsWith('UR:BYTES')) {
|
if (ret.data.toUpperCase().startsWith('UR:BYTES')) {
|
||||||
const splitted = ret.data.split('/');
|
const splitted = ret.data.split('/');
|
||||||
if (splitted.length === 3 && splitted[1].includes('-')) {
|
if (splitted.length === 3 && splitted[1].includes('-')) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue