rename seed to recovery phrase

pull/1306/head
Audric Ackermann 5 years ago
parent ad4c024530
commit 38c099cdf0
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -151,8 +151,8 @@ export class LeftPaneSettingSection extends React.Component<Props, State> {
const dangerButtonText = isSecondaryDevice
? window.i18n('unpairDevice')
: window.i18n('deleteAccount');
const showSeed = window.i18n('showSeed');
: window.i18n('clearAllData');
const showRecoveryPhrase = window.i18n('showRecoveryPhrase');
return (
<div className="left-pane-setting-bottom-buttons">
@ -164,7 +164,7 @@ export class LeftPaneSettingSection extends React.Component<Props, State> {
/>
{!isSecondaryDevice && (
<SessionButton
text={showSeed}
text={showRecoveryPhrase}
buttonType={SessionButtonType.SquareOutline}
buttonColor={SessionButtonColor.White}
onClick={window.showSeedDialog}

@ -12,7 +12,7 @@ interface State {
error: string;
loadingPassword: boolean;
loadingSeed: boolean;
seed: string;
recoveryPhrase: string;
hasPassword: boolean | null;
passwordHash: string;
passwordValid: boolean;
@ -26,14 +26,14 @@ export class SessionSeedModal extends React.Component<Props, State> {
error: '',
loadingPassword: true,
loadingSeed: true,
seed: '',
recoveryPhrase: '',
hasPassword: null,
passwordHash: '',
passwordValid: false,
};
this.copySeed = this.copySeed.bind(this);
this.getSeed = this.getSeed.bind(this);
this.copyRecoveryPhrase = this.copyRecoveryPhrase.bind(this);
this.getRecoveryPhrase = this.getRecoveryPhrase.bind(this);
this.confirmPassword = this.confirmPassword.bind(this);
this.checkHasPassword = this.checkHasPassword.bind(this);
this.onEnter = this.onEnter.bind(this);
@ -47,7 +47,7 @@ export class SessionSeedModal extends React.Component<Props, State> {
const i18n = window.i18n;
this.checkHasPassword();
this.getSeed().ignore();
this.getRecoveryPhrase().ignore();
const { onClose } = this.props;
const { hasPassword, passwordValid } = this.state;
@ -57,7 +57,7 @@ export class SessionSeedModal extends React.Component<Props, State> {
<>
{!loading && (
<SessionModal
title={i18n('showSeed')}
title={i18n('showRecoveryPhrase')}
onOk={() => null}
onClose={onClose}
>
@ -102,7 +102,7 @@ export class SessionSeedModal extends React.Component<Props, State> {
<div className="session-modal__button-group">
<SessionButton
text={i18n('confirm')}
text={i18n('ok')}
onClick={this.confirmPassword}
/>
@ -126,7 +126,7 @@ export class SessionSeedModal extends React.Component<Props, State> {
</p>
<div className="spacer-xs" />
<i className="session-modal__text-highlight">{this.state.seed}</i>
<i className="session-modal__text-highlight">{this.state.recoveryPhrase}</i>
</div>
<div className="spacer-lg" />
@ -134,9 +134,9 @@ export class SessionSeedModal extends React.Component<Props, State> {
<SessionButton text={i18n('ok')} onClick={onClose} />
<SessionButton
text={i18n('copySeed')}
text={i18n('copy')}
onClick={() => {
this.copySeed(this.state.seed);
this.copyRecoveryPhrase(this.state.recoveryPhrase);
}}
/>
</div>
@ -194,29 +194,29 @@ export class SessionSeedModal extends React.Component<Props, State> {
});
}
private async getSeed() {
if (this.state.seed) {
private async getRecoveryPhrase() {
if (this.state.recoveryPhrase) {
return false;
}
const manager = await window.getAccountManager();
const seed = manager.getCurrentMnemonic();
const recoveryPhrase = manager.getCurrentMnemonic();
this.setState({
seed,
recoveryPhrase,
loadingSeed: false,
});
return true;
}
private copySeed(seed: string) {
window.clipboard.writeText(seed);
private copyRecoveryPhrase(recoveryPhrase: string) {
window.clipboard.writeText(recoveryPhrase);
ToastUtils.push({
title: window.i18n('copiedToClipboard'),
type: 'success',
id: 'copySeedToast',
id: 'copyRecoveryPhraseToast',
});
}

@ -192,7 +192,7 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
<SessionButton
buttonType={SessionButtonType.BrandOutline}
buttonColor={SessionButtonColor.Green}
text={window.i18n('enter')}
text={window.i18n('ok')}
onClick={this.validatePasswordLock}
/>
</div>

Loading…
Cancel
Save