Merge pull request #3023 from BlueWallet/qrimage

FIX:  QR code scanning doesn't work on Android #3022
This commit is contained in:
GLaDOS 2021-04-28 10:27:54 +01:00 committed by GitHub
commit d900379188
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -106,7 +106,7 @@ const showImagePickerAndReadImage = () => {
},
response => {
if (response.uri) {
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.path.toString();
const uri = response.uri.toString().replace('file://', '');
LocalQRCode.decode(uri, (error, result) => {
if (!error) {
resolve(result);
@ -130,7 +130,7 @@ const takePhotoWithImagePickerAndReadPhoto = () => {
},
response => {
if (response.uri) {
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.path.toString();
const uri = response.uri.toString().replace('file://', '');
LocalQRCode.decode(uri, (error, result) => {
if (!error) {
resolve(result);
@ -174,7 +174,7 @@ const showFilePickerAndReadFile = async function () {
if (res?.type === DocumentPicker.types.images || res?.type?.startsWith('image/')) {
return new Promise(resolve => {
const uri = Platform.OS === 'ios' ? res.uri.toString().replace('file://', '') : res.uri;
const uri = res.uri.toString().replace('file://', '');
LocalQRCode.decode(decodeURI(uri), (error, result) => {
if (!error) {
resolve({ data: result, uri: decodeURI(res.uri) });

View File

@ -215,7 +215,7 @@ const ScanQRCode = () => {
setIsLoading(false);
} else {
if (response.uri) {
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.uri;
const uri = response.uri.toString().replace('file://', '');
LocalQRCode.decode(uri, (error, result) => {
if (!error) {
onBarCodeRead({ data: result });

View File

@ -463,7 +463,7 @@ const WalletTransactions = () => {
},
response => {
if (response.uri) {
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.uri;
const uri = response.uri.toString().replace('file://', '');
LocalQRCode.decode(uri, (error, result) => {
if (!error) {
onBarCodeRead({ data: result });