Skip to content

Commit

Permalink
Merge pull request #191 from VerusCoin/dev
Browse files Browse the repository at this point in the history
v1.0.21
  • Loading branch information
Asherda authored Nov 20, 2024
2 parents bd9fc1c + 1122ba5 commit 4a0e9ff
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 23 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.android.build.OutputFile

def versionMajor = 1
def versionMinor = 0
def versionRevision = 20
def versionRevision = 21
def versionBuild = 0

def keystorePropertiesFile = rootProject.file("keystore.properties");
Expand Down
2 changes: 1 addition & 1 deletion env/main.android.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"APP_VERSION": "1.0.20",
"APP_VERSION": "1.0.21",
"ELECTRUM_PROTOCOL_CHANGE": 1.4,

"KEY_DERIVATION_VERSION": 1,
Expand Down
2 changes: 1 addition & 1 deletion env/main.ios.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"APP_VERSION": "1.0.20",
"APP_VERSION": "1.0.21",
"ELECTRUM_PROTOCOL_CHANGE": 1.4,

"KEY_DERIVATION_VERSION": 1,
Expand Down
2 changes: 1 addition & 1 deletion ios/assets/env/main.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"APP_VERSION": "1.0.20",
"APP_VERSION": "1.0.21",
"ELECTRUM_PROTOCOL_CHANGE": 1.4,

"KEY_DERIVATION_VERSION": 1,
Expand Down
4 changes: 2 additions & 2 deletions ios/verusMobile.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@
"\"${PODS_CONFIGURATION_BUILD_DIR}/react-native-webview\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/rn-fetch-blob\"",
);
MARKETING_VERSION = 1.0.20;
MARKETING_VERSION = 1.0.21;
PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.verusmobile;
PRODUCT_NAME = verusmobile;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -817,7 +817,7 @@
"\"${PODS_CONFIGURATION_BUILD_DIR}/react-native-webview\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/rn-fetch-blob\"",
);
MARKETING_VERSION = 1.0.20;
MARKETING_VERSION = 1.0.21;
PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.verusmobile;
PRODUCT_NAME = verusmobile;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "verusmobile",
"version": "1.0.20",
"version": "1.0.21",
"private": true,
"scripts": {
"postinstall": "./node_modules/.bin/rn-nodeify --hack --install --yarn && npx jetify",
Expand Down
17 changes: 15 additions & 2 deletions src/components/BarcodeReader/BarcodeReader.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {useState, useEffect, useRef} from 'react';
import {View, ScrollView} from 'react-native';
import {View, ScrollView, AppState} from 'react-native';
import {Text, Button} from 'react-native-paper';
import { Camera, useCameraDevice, useCodeScanner } from 'react-native-vision-camera';
import Colors from '../../globals/colors';
Expand All @@ -14,8 +14,10 @@ import {triggerHapticSuccess} from '../../utils/haptics/haptics';
const BarcodeReader = props => {
const cameraProps = props.cameraProps == null ? {} : props.cameraProps;
const maskProps = props.maskProps == null ? {} : props.maskProps;
const appState = useRef(AppState.currentState);

const componentIsMounted = useRef(true);
const [appStateVisible, setAppStateVisible] = useState(appState.current);
const [needToGoToSettings, setNeedToGoToSettings] = useState(false);
const [hasCameraPermission, setHasCameraPermission] = useState(false);
const [loading, setLoading] = useState(false);
Expand Down Expand Up @@ -49,6 +51,17 @@ const BarcodeReader = props => {
}
})

useEffect(() => {
const subscription = AppState.addEventListener('change', nextAppState => {
appState.current = nextAppState;
setAppStateVisible(appState.current);
});

return () => {
subscription.remove();
};
}, []);

const onMount = async () => {
const permissionStatus = await verifyPermissions(
PERMISSIONS.IOS.CAMERA,
Expand Down Expand Up @@ -95,7 +108,7 @@ const BarcodeReader = props => {
}}
device={device}
codeScanner={codeScanner}
isActive={true}
isActive={appStateVisible === 'active'}
{...cameraProps}
/>
<View style={{
Expand Down
4 changes: 2 additions & 2 deletions src/components/ScanSeed.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class ScanSeed extends Component {
}

onSuccess(codes) {
let result = codes[0]
let result = codes[0] ? codes[0].value : null;

if (typeof result === "string" && result.length <= 5000 && this.props.onScan) {
if (result != null && typeof result === "string" && result.length <= 5000 && this.props.onScan) {
this.props.onScan(result)
} else {
this.errorHandler(FORMAT_UNKNOWN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ const RecoverIdentityForm = (props) => {
}, []);

const handleScan = (codes) => {
const result = codes[0]
const result = codes[0] ? codes[0].value : null;
setScannerOpen(false)

if (typeof result === "string" && result.length <= 5000) {
if (result != null && typeof result === "string" && result.length <= 5000) {
props.updateSendFormData(scannerField, result)
} else {
Alert.alert("Error", "Unknown data in qr code")
Expand Down
4 changes: 2 additions & 2 deletions src/components/SetupSeedModal/ImportSeed/ImportSeed.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class ImportSeed extends Component {
if (lastState !== this.state) this.props.saveState(this.state);
}

handleScan = (codes) => {
this.setState({ seed: codes[0], scanning: false });
handleScan = (seed) => {
this.setState({ seed, scanning: false });
};

verifySeed = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export default function ImportText({
const [showSeed, setShowSeed] = useState(false);
const [scanQr, setScanQr] = useState(qr === true);

const handleScan = (codes) => {
const handleScan = (seed) => {
setScanQr(false)
setImportedSeed(codes[0])
setImportedSeed(seed)
}

const handleImport = () => {
Expand All @@ -39,7 +39,7 @@ export default function ImportText({
return scanQr ? (
<ScanSeed
cancel={() => setScanQr(false)}
onScan={(codes) => handleScan(codes)}
onScan={(seed) => handleScan(seed)}
/>
) : (
<TouchableWithoutFeedback onPress={() => Keyboard.dismiss()}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,12 @@ class CoinSettings extends Component {
<View style={Styles.highFooterContainer}>
<View style={Styles.standardWidthSpaceBetweenBlock}>
<Button
buttonColor={Colors.warningButtonColor}
textColor={Colors.secondaryColor}
textColor={Colors.warningButtonColor}
onPress={this.back}
disabled={this.state.loading}
>{"Back"}</Button>
<Button
textColor={Colors.linkButtonColor}
mode="contained"
onPress={this._handleSubmit}
disabled={this.state.loading}
>{"Confirm"}</Button>
Expand Down
4 changes: 2 additions & 2 deletions src/containers/VerusPay/VerusPay.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ class VerusPay extends Component {
}

onSuccess(codes) {
let result = codes[0];

try {
let result = codes[0].value;

try {
this.tryProcessDeeplink(result)
return
Expand Down

0 comments on commit 4a0e9ff

Please sign in to comment.