Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Mobile: Fix SeedVault export name #1312

Merged
merged 1 commit into from
Apr 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/mobile/src/ui/components/SeedVaultExportComponent.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import isEmpty from 'lodash/isEmpty';
import values from 'lodash/values';
import isEqual from 'lodash/isEqual';
import React, { Component } from 'react';
Expand Down Expand Up @@ -168,8 +169,12 @@ class SeedVaultExportComponent extends Component {
await getAndroidFileSystemPermissions();
}
const { t, selectedAccountName } = this.props;

const path = SeedVaultExportComponent.getPath(removeNonAlphaNumeric(selectedAccountName, 'SeedVault').trim());
const path = SeedVaultExportComponent.getPath(
removeNonAlphaNumeric(
isEmpty(global.onboardingSeed) ? selectedAccountName : '',
SEED_VAULT_DEFAULT_TITLE,
).trim(),
);

this.setState({ path });

Expand Down Expand Up @@ -261,7 +266,10 @@ class SeedVaultExportComponent extends Component {
// If it's undefined, use the fallback title
serialise({
seed: tritsToChars(this.state.seed),
title: removeNonAlphaNumeric(selectedAccountName, SEED_VAULT_DEFAULT_TITLE),
title: removeNonAlphaNumeric(
isEmpty(global.onboardingSeed) ? selectedAccountName : '',
SEED_VAULT_DEFAULT_TITLE,
),
}) +
'~' +
UInt8ToString(this.state.password),
Expand Down
1 change: 1 addition & 0 deletions src/mobile/src/ui/views/onboarding/NewSeedSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ class NewSeedSetup extends Component {
}

onBackPress() {
delete global.onboardingSeed;
navigator.pop(this.props.componentId);
}

Expand Down
1 change: 1 addition & 0 deletions src/mobile/src/ui/views/onboarding/SetAccountName.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export class SetAccountName extends Component {
if (onboardingComplete) {
const seedStore = await new SeedStore.keychain(global.passwordHash);
seedStore.addAccount(accountName, global.onboardingSeed);
delete global.onboardingSeed;
navigator.setStackRoot('loading');
} else {
navigator.push('setPassword');
Expand Down