From af08177f79decd8dd3194d300a1fa43d43872229 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Mon, 29 Jan 2018 12:10:49 +0100
Subject: Make it such that users can switch between Ledger accounts without
 first switching back to an injected provider

---
 packages/website/ts/components/top_bar/provider_picker.tsx | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

(limited to 'packages/website/ts/components/top_bar/provider_picker.tsx')

diff --git a/packages/website/ts/components/top_bar/provider_picker.tsx b/packages/website/ts/components/top_bar/provider_picker.tsx
index 75261ab94..98678dee6 100644
--- a/packages/website/ts/components/top_bar/provider_picker.tsx
+++ b/packages/website/ts/components/top_bar/provider_picker.tsx
@@ -37,17 +37,15 @@ export class ProviderPicker extends React.Component<ProviderPickerProps, Provide
         // Show dropdown with two options
         return (
             <div style={{ width: 225, overflow: 'hidden' }}>
-                <RadioButtonGroup
-                    name="provider"
-                    defaultSelected={this.props.providerType}
-                    onChange={this._onProviderRadioChanged.bind(this)}
-                >
+                <RadioButtonGroup name="provider" defaultSelected={this.props.providerType}>
                     <RadioButton
+                        onClick={this._onProviderRadioChanged.bind(this, ProviderType.Injected)}
                         style={{ ...menuStyle, backgroundColor: !isLedgerSelected && colors.grey50 }}
                         value={ProviderType.Injected}
                         label={this._renderLabel(this.props.injectedProviderName, !isLedgerSelected)}
                     />
                     <RadioButton
+                        onClick={this._onProviderRadioChanged.bind(this, ProviderType.Ledger)}
                         style={{ ...menuStyle, backgroundColor: isLedgerSelected && colors.grey50 }}
                         value={ProviderType.Ledger}
                         label={this._renderLabel('Ledger Nano S', isLedgerSelected)}
@@ -80,7 +78,7 @@ export class ProviderPicker extends React.Component<ProviderPickerProps, Provide
             </div>
         );
     }
-    private _onProviderRadioChanged(e: any, value: string) {
+    private _onProviderRadioChanged(value: string) {
         if (value === ProviderType.Ledger) {
             this.props.onToggleLedgerDialog();
         } else {
-- 
cgit v1.2.3

