Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Make send flow work in the simulator #337

Merged
merged 1 commit into from
Feb 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/model/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ethers } from 'ethers';
import lang from 'i18n-js';
import { get, isEmpty, isNil } from 'lodash';
import { Alert } from 'react-native';
import DeviceInfo from 'react-native-device-info';
import {
ACCESS_CONTROL,
ACCESSIBLE,
Expand Down Expand Up @@ -203,7 +204,15 @@ const saveWalletDetails = async (seedPhrase, privateKey, address) => {
authenticationType: AUTHENTICATION_TYPE.DEVICE_PASSCODE_OR_BIOMETRICS,
});
let accessControlOptions = {};

let isSimulator = false;

if (canAuthenticate) {
// eslint-disable-next-line no-undef
isSimulator = __DEV__ && (await DeviceInfo.isSimulator());
jinchung marked this conversation as resolved.
Show resolved Hide resolved
}

if (canAuthenticate && !isSimulator) {
accessControlOptions = {
accessControl: ACCESS_CONTROL.USER_PRESENCE,
accessible: ACCESSIBLE.WHEN_UNLOCKED_THIS_DEVICE_ONLY,
Expand Down