diff --git a/ui/js/page/settings/view.jsx b/ui/js/page/settings/view.jsx index 186abbb5c..27cb1c9f0 100644 --- a/ui/js/page/settings/view.jsx +++ b/ui/js/page/settings/view.jsx @@ -13,8 +13,6 @@ class SettingsPage extends React.PureComponent { super(props); this.state = { - instantPurchaseEnabled: props.instantPurchaseEnabled, - instantPurchaseMax: props.instantPurchaseMax, clearingCache: false, }; } @@ -49,7 +47,14 @@ class SettingsPage extends React.PureComponent { } onKeyFeeChange(newValue) { - this.setDaemonSetting("max_key_fee", newValue); + let setting = newValue; + + //this is stupid and should be fixed... somewhere + if (setting && (setting.amount === undefined || setting.amount === null)) { + setting.amount = 0; + } + + this.setDaemonSetting("max_key_fee", setting); } onKeyFeeDisableChange(isDisabled) { @@ -61,20 +66,12 @@ class SettingsPage extends React.PureComponent { this.props.setClientSetting(settings.THEME, value); } - oninstantPurchaseEnabledChange(enabled) { + onInstantPurchaseEnabledChange(enabled) { this.props.setClientSetting(settings.INSTANT_PURCHASE_ENABLED, enabled); - - this.setState({ - instantPurchaseEnabled: enabled, - }); } onInstantPurchaseMaxChange(newValue) { this.props.setClientSetting(settings.INSTANT_PURCHASE_MAX, newValue); - - this.setState({ - instantPurchaseMax: newValue, - }); } // onMaxUploadPrefChange(isLimited) { @@ -245,31 +242,31 @@ class SettingsPage extends React.PureComponent { { - this.oninstantPurchaseEnabledChange(false); + this.onInstantPurchaseEnabledChange(false); }} />
{ - this.oninstantPurchaseEnabledChange(true); + this.onInstantPurchaseEnabledChange(true); }} /> - {this.state.instantPurchaseEnabled && + {instantPurchaseEnabled && this.onInstantPurchaseMaxChange(val)} - defaultValue={this.state.instantPurchaseMax} + defaultValue={instantPurchaseMax} />}