Skip to content

Commit

Permalink
Revert "undo custom changes"
Browse files Browse the repository at this point in the history
This reverts commit 774113e.
  • Loading branch information
estebanmino committed Feb 13, 2020
1 parent 17d2a9e commit 54acd16
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 25 deletions.
46 changes: 30 additions & 16 deletions app/components/Views/AccountBackupStep4/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { colors, fontStyles } from '../../../styles/common';
import StyledButton from '../../UI/StyledButton';
import { strings } from '../../../../locales/i18n';
import Engine from '../../../core/Engine';
import SecureKeychain from '../../../core/SecureKeychain';
// import SecureKeychain from '../../../core/SecureKeychain';

const styles = StyleSheet.create({
mainWrapper: {
Expand Down Expand Up @@ -132,7 +132,7 @@ const styles = StyleSheet.create({

const WRONG_PASSWORD_ERROR = 'Error: Decrypt failed';
const SEED_PHRASE = 'seed_phrase';
const CONFIRM_PASSWORD = 'confirm_password';
// const CONFIRM_PASSWORD = 'confirm_password';
/**
* View that's shown during the fourth step of
* the backup seed phrase flow
Expand Down Expand Up @@ -165,20 +165,34 @@ export default class AccountBackupStep4 extends PureComponent {
};

async componentDidMount() {
this.words = this.props.navigation.getParam('words', []);
// If the user is going to the backup seed flow directly
if (!this.words.length) {
try {
const credentials = await SecureKeychain.getGenericPassword();
if (credentials) {
this.words = await this.tryExportSeedPhrase(credentials.password);
} else {
this.setState({ view: CONFIRM_PASSWORD });
}
} catch (e) {
this.setState({ view: CONFIRM_PASSWORD });
}
}
// this.words = this.props.navigation.getParam('words', []);
// // If the user is going to the backup seed flow directly
// if (!this.words.length) {
// try {
// const credentials = await SecureKeychain.getGenericPassword();
// if (credentials) {
// this.words = await this.tryExportSeedPhrase(credentials.password);
// } else {
// this.setState({ view: CONFIRM_PASSWORD });
// }
// } catch (e) {
// this.setState({ view: CONFIRM_PASSWORD });
// }
// }
this.words = [
'outdoor',
'group',
'glove',
'unhappy',
'speed',
'pattern',
'fix',
'devote',
'renew',
'lyrics',
'wool',
'speed'
];
this.setState({ ready: true });
}

Expand Down
26 changes: 20 additions & 6 deletions app/components/Views/AccountBackupStep5/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,26 @@ class AccountBackupStep5 extends PureComponent {

constructor(props) {
super(props);
const words = props.navigation.getParam('words', []);
if (process.env.JEST_WORKER_ID === undefined) {
this.words = [...words].sort(() => 0.5 - Math.random());
} else {
this.words = words;
}
// const words = props.navigation.getParam('words', []);
// if (process.env.JEST_WORKER_ID === undefined) {
// this.words = [...words].sort(() => 0.5 - Math.random());
// } else {
// this.words = words;
// }
this.words = [
'outdoor',
'group',
'glove',
'unhappy',
'speed',
'pattern',
'fix',
'devote',
'renew',
'lyrics',
'wool',
'speed'
];
}

state = {
Expand Down
4 changes: 1 addition & 3 deletions app/components/Views/BrowserTab/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1875,9 +1875,7 @@ export class BrowserTab extends PureComponent {
{!isHidden && this.renderOptions()}
{!isHidden && this.renderBottomBar()}
{!isHidden && this.renderOnboardingWizard()}
{!isHidden && this.props.passwordSet && !this.props.seedphraseBackedUp && (
<BackupAlert onPress={this.backupAlertPress} style={styles.backupAlert} />
)}
<BackupAlert onPress={this.backupAlertPress} style={styles.backupAlert} />
</View>
);
}
Expand Down

0 comments on commit 54acd16

Please sign in to comment.