mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-12 18:51:21 +01:00
wip
This commit is contained in:
parent
554898dbeb
commit
b4367f156e
3 changed files with 9 additions and 38 deletions
|
@ -79,18 +79,4 @@ export type SendDetailsStackParamList = {
|
|||
PaymentCodeList: {
|
||||
walletID: string;
|
||||
};
|
||||
ScanQRCodeRoot: {
|
||||
screen: string;
|
||||
params: {
|
||||
isLoading?: boolean;
|
||||
cameraStatusGranted?: boolean;
|
||||
backdoorPressed?: boolean;
|
||||
launchedBy?: string;
|
||||
urTotal?: number;
|
||||
urHave?: number;
|
||||
backdoorText?: string;
|
||||
showFileImportButton?: boolean;
|
||||
onBarScanned: (data: string) => void;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -39,7 +39,7 @@ import Button from '../../components/Button';
|
|||
import CoinsSelected from '../../components/CoinsSelected';
|
||||
import InputAccessoryAllFunds, { InputAccessoryAllFundsAccessoryViewID } from '../../components/InputAccessoryAllFunds';
|
||||
import { useTheme } from '../../components/themes';
|
||||
import { requestCameraAuthorization, scanQrHelper } from '../../helpers/scan-qr';
|
||||
import { scanQrHelper } from '../../helpers/scan-qr';
|
||||
import loc, { formatBalance, formatBalanceWithoutSuffix } from '../../loc';
|
||||
import { BitcoinUnit, Chain } from '../../models/bitcoinUnits';
|
||||
import NetworkTransactionFees, { NetworkTransactionFee } from '../../models/networkTransactionFees';
|
||||
|
@ -679,22 +679,13 @@ const SendDetails = () => {
|
|||
*
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
const importQrTransaction = () => {
|
||||
const importQrTransaction = async () => {
|
||||
if (wallet?.type !== WatchOnlyWallet.type) {
|
||||
return presentAlert({ title: loc.errors.error, message: 'Importing transaction in non-watchonly wallet (this should never happen)' });
|
||||
}
|
||||
|
||||
requestCameraAuthorization().then(() => {
|
||||
feeModalRef.current?.dismiss();
|
||||
|
||||
navigation.navigate('ScanQRCodeRoot', {
|
||||
screen: 'ScanQRCode',
|
||||
params: {
|
||||
onBarScanned: importQrTransactionOnBarScanned,
|
||||
showFileImportButton: false,
|
||||
},
|
||||
});
|
||||
});
|
||||
const data = await scanQrHelper(route.name, true);
|
||||
importQrTransactionOnBarScanned(data);
|
||||
};
|
||||
|
||||
const importQrTransactionOnBarScanned = (ret: any) => {
|
||||
|
@ -852,15 +843,8 @@ const SendDetails = () => {
|
|||
};
|
||||
|
||||
const importTransactionMultisigScanQr = async () => {
|
||||
await requestCameraAuthorization().then(() => {
|
||||
navigation.navigate('ScanQRCodeRoot', {
|
||||
screen: 'ScanQRCode',
|
||||
params: {
|
||||
onBarScanned,
|
||||
showFileImportButton: true,
|
||||
},
|
||||
});
|
||||
});
|
||||
const data = await scanQrHelper(route.name, true);
|
||||
onBarScanned(data);
|
||||
};
|
||||
|
||||
const handleAddRecipient = () => {
|
||||
|
|
|
@ -215,8 +215,9 @@ const PsbtWithHardwareWallet = () => {
|
|||
}
|
||||
};
|
||||
|
||||
const openScanner = () => {
|
||||
scanQrHelper(route.name, false, onBarScanned);
|
||||
const openScanner = async () => {
|
||||
const scannedData = await scanQrHelper(route.name, true);
|
||||
onBarScanned({ data: scannedData });
|
||||
};
|
||||
|
||||
if (txHex) return _renderBroadcastHex();
|
||||
|
|
Loading…
Add table
Reference in a new issue