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

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

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

Loading…
Cancel
Save