Disable Trezor in Sign & Verify Message Tab (#673)
This commit is contained in:
parent
a660ba94d8
commit
999587ea2f
|
@ -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) {
|
||||
|
|
|
@ -64,7 +64,7 @@ export class SignMessage extends Component<Props, State> {
|
|||
onSignMessage={this.onSignMessage}
|
||||
/>
|
||||
)}
|
||||
<WalletDecrypt hidden={unlocked} />
|
||||
<WalletDecrypt hidden={unlocked} disabledWallets={['trezor']} />
|
||||
|
||||
{!!signedMessage && (
|
||||
<div>
|
||||
|
|
Loading…
Reference in New Issue