From 805ccef7a12959a000b7b6daa33569091741626f Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Mon, 20 Jan 2020 10:27:16 +1100 Subject: [PATCH] fix default name for linked device --- ts/components/DevicePairingDialog.tsx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/ts/components/DevicePairingDialog.tsx b/ts/components/DevicePairingDialog.tsx index 8ff00cb70..86221c937 100644 --- a/ts/components/DevicePairingDialog.tsx +++ b/ts/components/DevicePairingDialog.tsx @@ -10,13 +10,13 @@ interface Props { } interface State { - currentPubKey: string | null; + currentPubKey: string | undefined; accepted: boolean; pubKeyRequests: Array; currentView: 'filterRequestView' | 'qrcodeView'; errors: any; loading: boolean; - deviceAlias: string | null; + deviceAlias: string | undefined; } export class DevicePairingDialog extends React.Component { @@ -33,13 +33,13 @@ export class DevicePairingDialog extends React.Component { this.handleUpdateDeviceAlias = this.handleUpdateDeviceAlias.bind(this); this.state = { - currentPubKey: null, + currentPubKey: undefined, accepted: false, pubKeyRequests: Array(), currentView: 'qrcodeView', loading: false, errors: undefined, - deviceAlias: null, + deviceAlias: 'Unnamed Device', }; } @@ -59,7 +59,6 @@ export class DevicePairingDialog extends React.Component { public renderFilterRequestsView() { const { currentPubKey, accepted, deviceAlias } = this.state; const secretWords = window.mnemonic.pubkey_to_secret_words(currentPubKey); - const deviceAliasPlaceholder = 'Unnamed Device'; if (accepted) { return ( @@ -69,7 +68,7 @@ export class DevicePairingDialog extends React.Component { onClose={this.closeDialog} >
- {deviceAliasPlaceholder} +
{ private reset() { this.setState({ - currentPubKey: null, + currentPubKey: undefined, accepted: false, pubKeyRequests: Array(), currentView: 'filterRequestView', - deviceAlias: null, + deviceAlias: 'Unnamed Device', }); } @@ -312,7 +311,7 @@ export class DevicePairingDialog extends React.Component { if (!!trimmed) { this.setState({ deviceAlias: trimmed }); } else { - this.setState({ deviceAlias: null }); + this.setState({ deviceAlias: undefined }); } } }