mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-03 20:07:11 +01:00
FIX: Android crash
This commit is contained in:
parent
85fa3122cf
commit
8a6ba6cb02
10 changed files with 17 additions and 17 deletions
|
@ -1624,7 +1624,7 @@ export class BlueAddressInput extends Component {
|
||||||
},
|
},
|
||||||
response => {
|
response => {
|
||||||
if (response.uri) {
|
if (response.uri) {
|
||||||
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.path.toString();
|
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.uri;
|
||||||
LocalQRCode.decode(uri, (error, result) => {
|
LocalQRCode.decode(uri, (error, result) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
this.props.onBarScanned(result);
|
this.props.onBarScanned(result);
|
||||||
|
@ -1646,7 +1646,7 @@ export class BlueAddressInput extends Component {
|
||||||
},
|
},
|
||||||
response => {
|
response => {
|
||||||
if (response.uri) {
|
if (response.uri) {
|
||||||
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.path.toString();
|
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.uri;
|
||||||
LocalQRCode.decode(uri, (error, result) => {
|
LocalQRCode.decode(uri, (error, result) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
this.props.onBarScanned(result);
|
this.props.onBarScanned(result);
|
||||||
|
|
|
@ -119,7 +119,7 @@ const showFilePickerAndReadFile = async function () {
|
||||||
} else {
|
} else {
|
||||||
if (res.type === DocumentPicker.types.images || res.type.startsWith('image/')) {
|
if (res.type === DocumentPicker.types.images || res.type.startsWith('image/')) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
const uri = Platform.OS === 'ios' ? res.uri.toString().replace('file://', '') : res.path.toString();
|
const uri = Platform.OS === 'ios' ? res.uri.toString().replace('file://', '') : res.uri;
|
||||||
LocalQRCode.decode(decodeURI(uri), (error, result) => {
|
LocalQRCode.decode(decodeURI(uri), (error, result) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
resolve({ data: result, uri: decodeURI(res.uri) });
|
resolve({ data: result, uri: decodeURI(res.uri) });
|
||||||
|
|
|
@ -200,7 +200,7 @@ const ScanQRCode = () => {
|
||||||
},
|
},
|
||||||
response => {
|
response => {
|
||||||
if (response.uri) {
|
if (response.uri) {
|
||||||
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.path.toString();
|
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.uri;
|
||||||
LocalQRCode.decode(uri, (error, result) => {
|
LocalQRCode.decode(uri, (error, result) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
onBarCodeRead({ data: result });
|
onBarCodeRead({ data: result });
|
||||||
|
|
|
@ -57,7 +57,7 @@ const PsbtMultisigQRCode = () => {
|
||||||
},
|
},
|
||||||
response => {
|
response => {
|
||||||
if (response.uri) {
|
if (response.uri) {
|
||||||
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.path.toString();
|
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.uri;
|
||||||
LocalQRCode.decode(uri, (error, result) => {
|
LocalQRCode.decode(uri, (error, result) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
onBarScanned(result);
|
onBarScanned(result);
|
||||||
|
|
|
@ -13,7 +13,7 @@ import {
|
||||||
StyleSheet,
|
StyleSheet,
|
||||||
Alert,
|
Alert,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import ImagePicker from 'react-native-image-picker';
|
import { launchCamera } from 'react-native-image-picker';
|
||||||
import Clipboard from '@react-native-community/clipboard';
|
import Clipboard from '@react-native-community/clipboard';
|
||||||
import {
|
import {
|
||||||
SecondButton,
|
SecondButton,
|
||||||
|
@ -244,7 +244,7 @@ const PsbtWithHardwareWallet = () => {
|
||||||
|
|
||||||
const openScanner = () => {
|
const openScanner = () => {
|
||||||
if (isDesktop) {
|
if (isDesktop) {
|
||||||
ImagePicker.launchCamera(
|
launchCamera(
|
||||||
{
|
{
|
||||||
title: null,
|
title: null,
|
||||||
mediaType: 'photo',
|
mediaType: 'photo',
|
||||||
|
@ -252,7 +252,7 @@ const PsbtWithHardwareWallet = () => {
|
||||||
},
|
},
|
||||||
response => {
|
response => {
|
||||||
if (response.uri) {
|
if (response.uri) {
|
||||||
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.path.toString();
|
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.uri;
|
||||||
LocalQRCode.decode(uri, (error, result) => {
|
LocalQRCode.decode(uri, (error, result) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
onBarScanned(result);
|
onBarScanned(result);
|
||||||
|
|
|
@ -29,7 +29,7 @@ import { HDSegwitBech32Wallet, MultisigCosigner, MultisigHDWallet } from '../../
|
||||||
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
|
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
|
||||||
import loc from '../../loc';
|
import loc from '../../loc';
|
||||||
import { getSystemName } from 'react-native-device-info';
|
import { getSystemName } from 'react-native-device-info';
|
||||||
import ImagePicker from 'react-native-image-picker';
|
import { launchCamera } from 'react-native-image-picker';
|
||||||
import ScanQRCode from '../send/ScanQRCode';
|
import ScanQRCode from '../send/ScanQRCode';
|
||||||
import QRCode from 'react-native-qrcode-svg';
|
import QRCode from 'react-native-qrcode-svg';
|
||||||
import { SquareButton } from '../../components/SquareButton';
|
import { SquareButton } from '../../components/SquareButton';
|
||||||
|
@ -395,7 +395,7 @@ const WalletsAddMultisigStep2 = () => {
|
||||||
const scanOrOpenFile = () => {
|
const scanOrOpenFile = () => {
|
||||||
setIsProvideMnemonicsModalVisible(false);
|
setIsProvideMnemonicsModalVisible(false);
|
||||||
if (isDesktop) {
|
if (isDesktop) {
|
||||||
ImagePicker.launchCamera(
|
launchCamera(
|
||||||
{
|
{
|
||||||
title: null,
|
title: null,
|
||||||
mediaType: 'photo',
|
mediaType: 'photo',
|
||||||
|
@ -403,7 +403,7 @@ const WalletsAddMultisigStep2 = () => {
|
||||||
},
|
},
|
||||||
response => {
|
response => {
|
||||||
if (response.uri) {
|
if (response.uri) {
|
||||||
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.path.toString();
|
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.uri;
|
||||||
LocalQRCode.decode(uri, (error, result) => {
|
LocalQRCode.decode(uri, (error, result) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
onBarScanned(result);
|
onBarScanned(result);
|
||||||
|
|
|
@ -123,7 +123,7 @@ const WalletsImport = () => {
|
||||||
},
|
},
|
||||||
response => {
|
response => {
|
||||||
if (response.uri) {
|
if (response.uri) {
|
||||||
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.path.toString();
|
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.uri;
|
||||||
LocalQRCode.decode(uri, (error, result) => {
|
LocalQRCode.decode(uri, (error, result) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
onBarScanned(result);
|
onBarScanned(result);
|
||||||
|
@ -145,7 +145,7 @@ const WalletsImport = () => {
|
||||||
},
|
},
|
||||||
response => {
|
response => {
|
||||||
if (response.uri) {
|
if (response.uri) {
|
||||||
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.path.toString();
|
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.uri;
|
||||||
LocalQRCode.decode(uri, (error, result) => {
|
LocalQRCode.decode(uri, (error, result) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
onBarScanned(result);
|
onBarScanned(result);
|
||||||
|
|
|
@ -371,7 +371,7 @@ const WalletsList = () => {
|
||||||
},
|
},
|
||||||
response => {
|
response => {
|
||||||
if (response.uri) {
|
if (response.uri) {
|
||||||
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.path.toString();
|
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.uri;
|
||||||
LocalQRCode.decode(uri, (error, result) => {
|
LocalQRCode.decode(uri, (error, result) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
onBarScanned(result);
|
onBarScanned(result);
|
||||||
|
@ -393,7 +393,7 @@ const WalletsList = () => {
|
||||||
},
|
},
|
||||||
response => {
|
response => {
|
||||||
if (response.uri) {
|
if (response.uri) {
|
||||||
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.path.toString();
|
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.uri;
|
||||||
LocalQRCode.decode(uri, (error, result) => {
|
LocalQRCode.decode(uri, (error, result) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
onBarScanned(result);
|
onBarScanned(result);
|
||||||
|
|
|
@ -459,7 +459,7 @@ const WalletTransactions = () => {
|
||||||
},
|
},
|
||||||
response => {
|
response => {
|
||||||
if (response.uri) {
|
if (response.uri) {
|
||||||
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.path.toString();
|
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.uri;
|
||||||
LocalQRCode.decode(uri, (error, result) => {
|
LocalQRCode.decode(uri, (error, result) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
onBarCodeRead({ data: result });
|
onBarCodeRead({ data: result });
|
||||||
|
|
|
@ -390,7 +390,7 @@ const ViewEditMultisigCosigners = () => {
|
||||||
},
|
},
|
||||||
response => {
|
response => {
|
||||||
if (response.uri) {
|
if (response.uri) {
|
||||||
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.path.toString();
|
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.uri;
|
||||||
LocalQRCode.decode(uri, (error, result) => {
|
LocalQRCode.decode(uri, (error, result) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
_handleUseMnemonicPhrase(result);
|
_handleUseMnemonicPhrase(result);
|
||||||
|
|
Loading…
Add table
Reference in a new issue