Disable Trezor in Sign & Verify Message Tab (#673)

This commit is contained in:
skubakdj 2017-12-27 14:48:14 -05:00 committed by Daniel Ternyak
parent a660ba94d8
commit 999587ea2f
2 changed files with 11 additions and 2 deletions

View File

@ -45,6 +45,7 @@ interface Props {
hidden?: boolean;
offline: boolean;
allowReadOnly?: boolean;
disabledWallets?: string[];
}
interface State {
@ -139,7 +140,8 @@ export class WalletDecrypt extends Component<Props, State> {
const isSelected = this.state.selectedWalletKey === key;
const isDisabled =
this.isOnlineRequiredWalletAndOffline(key) ||
(!this.props.allowReadOnly && wallet.component === ViewOnlyDecrypt);
(!this.props.allowReadOnly && wallet.component === ViewOnlyDecrypt) ||
this.isWalletDisabled(key);
return (
<label className="radio" key={key}>
@ -221,6 +223,13 @@ export class WalletDecrypt extends Component<Props, State> {
this.WALLETS[this.state.selectedWalletKey].unlock(unlockValue);
this.props.resetTransactionState();
};
private isWalletDisabled = (walletKey: string) => {
if (!this.props.disabledWallets) {
return false;
}
return this.props.disabledWallets.indexOf(walletKey) !== -1;
};
}
function mapStateToProps(state: AppState) {

View File

@ -64,7 +64,7 @@ export class SignMessage extends Component<Props, State> {
onSignMessage={this.onSignMessage}
/>
)}
<WalletDecrypt hidden={unlocked} />
<WalletDecrypt hidden={unlocked} disabledWallets={['trezor']} />
{!!signedMessage && (
<div>