DEL: function is not needed anymore

This commit is contained in:
Marcos Rodriguez Velez 2024-03-24 18:54:34 -04:00
parent 16a8577c43
commit b436bdbd38
No known key found for this signature in database
GPG key ID: 6030B2F48CCE86D7
2 changed files with 11 additions and 28 deletions

View file

@ -1,5 +1,5 @@
import React, { useEffect, useRef, useState } from 'react';
import { ActivityIndicator, findNodeHandle, ScrollView, StyleSheet, View } from 'react-native';
import { ActivityIndicator, ScrollView, StyleSheet, View } from 'react-native';
import { useNavigation, useRoute, useIsFocused } from '@react-navigation/native';
import { BlueSpacing20 } from '../../BlueComponents';
@ -9,10 +9,9 @@ import { SquareButton } from '../../components/SquareButton';
import loc from '../../loc';
import presentAlert from '../../components/Alert';
import { requestCameraAuthorization } from '../../helpers/scan-qr';
import { scanQrHelper } from '../../helpers/scan-qr';
import { useTheme } from '../../components/themes';
import SafeArea from '../../components/SafeArea';
import { isDesktop } from '../../blue_modules/environment';
const bitcoin = require('bitcoinjs-lib');
const fs = require('../../blue_modules/fs');
@ -21,6 +20,7 @@ const PsbtMultisigQRCode = () => {
const { colors } = useTheme();
const openScannerButton = useRef();
const { psbtBase64, isShowOpenScanner } = useRoute().params;
const { name } = useRoute();
const [isLoading, setIsLoading] = useState(false);
const dynamicQRCode = useRef();
const isFocused = useIsFocused();
@ -61,20 +61,9 @@ const PsbtMultisigQRCode = () => {
}
};
const openScanner = () => {
if (isDesktop) {
fs.showActionSheet({ anchor: findNodeHandle(openScannerButton.current) }).then(data => onBarScanned({ data }));
} else {
requestCameraAuthorization().then(() =>
navigate('ScanQRCodeRoot', {
screen: 'ScanQRCode',
params: {
onBarScanned,
showFileImportButton: true,
},
}),
);
}
const openScanner = async () => {
const scanned = await scanQrHelper(navigate, name, true);
onBarScanned({ data: scanned });
};
const exportPSBT = () => {

View file

@ -13,7 +13,6 @@ import {
Text,
TouchableOpacity,
View,
findNodeHandle,
} from 'react-native';
import { Icon } from 'react-native-elements';
import { useFocusEffect, useNavigation, useRoute } from '@react-navigation/native';
@ -37,7 +36,6 @@ import { useTheme } from '../../components/themes';
import Button from '../../components/Button';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import usePrivacy from '../../hooks/usePrivacy';
import { isDesktop } from '../../blue_modules/environment';
const prompt = require('../../helpers/prompt');
const A = require('../../blue_modules/analytics');
@ -467,15 +465,11 @@ const WalletsAddMultisigStep2 = () => {
};
const scanOrOpenFile = () => {
if (isDesktop) {
fs.showActionSheet({ anchor: findNodeHandle(openScannerButton.current) }).then(onBarScanned);
} else {
setIsProvideMnemonicsModalVisible(false);
InteractionManager.runAfterInteractions(async () => {
const scanned = await scanQrHelper(navigation.navigate, name, true);
onBarScanned({ data: scanned });
});
}
setIsProvideMnemonicsModalVisible(false);
InteractionManager.runAfterInteractions(async () => {
const scanned = await scanQrHelper(navigation.navigate, name, true);
onBarScanned({ data: scanned });
});
};
const dashType = ({ index, lastIndex, isChecked, isFocus }) => {