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: {
|
PaymentCodeList: {
|
||||||
walletID: string;
|
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 CoinsSelected from '../../components/CoinsSelected';
|
||||||
import InputAccessoryAllFunds, { InputAccessoryAllFundsAccessoryViewID } from '../../components/InputAccessoryAllFunds';
|
import InputAccessoryAllFunds, { InputAccessoryAllFundsAccessoryViewID } from '../../components/InputAccessoryAllFunds';
|
||||||
import { useTheme } from '../../components/themes';
|
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 loc, { formatBalance, formatBalanceWithoutSuffix } from '../../loc';
|
||||||
import { BitcoinUnit, Chain } from '../../models/bitcoinUnits';
|
import { BitcoinUnit, Chain } from '../../models/bitcoinUnits';
|
||||||
import NetworkTransactionFees, { NetworkTransactionFee } from '../../models/networkTransactionFees';
|
import NetworkTransactionFees, { NetworkTransactionFee } from '../../models/networkTransactionFees';
|
||||||
|
@ -679,22 +679,13 @@ const SendDetails = () => {
|
||||||
*
|
*
|
||||||
* @returns {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
const importQrTransaction = () => {
|
const importQrTransaction = async () => {
|
||||||
if (wallet?.type !== WatchOnlyWallet.type) {
|
if (wallet?.type !== WatchOnlyWallet.type) {
|
||||||
return presentAlert({ title: loc.errors.error, message: 'Importing transaction in non-watchonly wallet (this should never happen)' });
|
return presentAlert({ title: loc.errors.error, message: 'Importing transaction in non-watchonly wallet (this should never happen)' });
|
||||||
}
|
}
|
||||||
|
|
||||||
requestCameraAuthorization().then(() => {
|
const data = await scanQrHelper(route.name, true);
|
||||||
feeModalRef.current?.dismiss();
|
importQrTransactionOnBarScanned(data);
|
||||||
|
|
||||||
navigation.navigate('ScanQRCodeRoot', {
|
|
||||||
screen: 'ScanQRCode',
|
|
||||||
params: {
|
|
||||||
onBarScanned: importQrTransactionOnBarScanned,
|
|
||||||
showFileImportButton: false,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const importQrTransactionOnBarScanned = (ret: any) => {
|
const importQrTransactionOnBarScanned = (ret: any) => {
|
||||||
|
@ -852,15 +843,8 @@ const SendDetails = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const importTransactionMultisigScanQr = async () => {
|
const importTransactionMultisigScanQr = async () => {
|
||||||
await requestCameraAuthorization().then(() => {
|
const data = await scanQrHelper(route.name, true);
|
||||||
navigation.navigate('ScanQRCodeRoot', {
|
onBarScanned(data);
|
||||||
screen: 'ScanQRCode',
|
|
||||||
params: {
|
|
||||||
onBarScanned,
|
|
||||||
showFileImportButton: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleAddRecipient = () => {
|
const handleAddRecipient = () => {
|
||||||
|
|
|
@ -215,8 +215,9 @@ const PsbtWithHardwareWallet = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const openScanner = () => {
|
const openScanner = async () => {
|
||||||
scanQrHelper(route.name, false, onBarScanned);
|
const scannedData = await scanQrHelper(route.name, true);
|
||||||
|
onBarScanned({ data: scannedData });
|
||||||
};
|
};
|
||||||
|
|
||||||
if (txHex) return _renderBroadcastHex();
|
if (txHex) return _renderBroadcastHex();
|
||||||
|
|
Loading…
Add table
Reference in a new issue