Skip to content

Commit

Permalink
DEL: Unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosrdz committed Apr 6, 2023
1 parent 72271f1 commit d7daf40
Showing 1 changed file with 2 additions and 31 deletions.
33 changes: 2 additions & 31 deletions screen/send/ScanQRCode.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
import React, { useState } from 'react';
import { Image, View, TouchableOpacity, StatusBar, Platform, StyleSheet, TextInput, Alert } from 'react-native';
import { CameraScreen, Camera } from 'react-native-camera-kit';
import { CameraScreen } from 'react-native-camera-kit';
import { Icon } from 'react-native-elements';
import { launchImageLibrary } from 'react-native-image-picker';
import { decodeUR, extractSingleWorkload, BlueURDecoder } from '../../blue_modules/ur';
Expand Down Expand Up @@ -117,35 +117,6 @@ const ScanQRCode = () => {
return createHash('sha256').update(s).digest().toString('hex');
};

useEffect(() => {
(async () => {
if (Platform.OS !== 'ios' && Platform.OS !== 'macos') {
return;
}
let isUserAuthorizedCamera;
const isCameraAuthorized = await Camera.checkDeviceCameraAuthorizationStatus();
switch (isCameraAuthorized) {
case true:
setCameraStatus(CameraAuthStatus.AUTHORIZED);
break;
case false:
setCameraStatus(CameraAuthStatus.NOT_AUTHORIZED);
isUserAuthorizedCamera = await Camera.requestDeviceCameraAuthorization();
if (isUserAuthorizedCamera) {
setCameraStatus(CameraAuthStatus.AUTHORIZED);
}
break;
case -1:
setCameraStatus(CameraAuthStatus.UNKNOWN);
isUserAuthorizedCamera = await Camera.requestDeviceCameraAuthorization();
if (isUserAuthorizedCamera) {
setCameraStatus(CameraAuthStatus.AUTHORIZED);
}
break;
}
})();
}, []);

const _onReadUniformResourceV2 = part => {
if (!decoder) decoder = new BlueURDecoder();
try {
Expand Down

0 comments on commit d7daf40

Please sign in to comment.