This commit is contained in:
Sean Yesmunt 2019-02-08 03:59:41 -05:00
parent 62fd918587
commit 1b14afbd7d

View file

@ -12,6 +12,8 @@ export type Price = {
amount: number, amount: number,
}; };
type SetDaemonSettingArg = boolean | string | Price;
type DaemonSettings = { type DaemonSettings = {
download_dir: string, download_dir: string,
share_usage_data: boolean, share_usage_data: boolean,
@ -19,8 +21,8 @@ type DaemonSettings = {
}; };
type Props = { type Props = {
setDaemonSetting: (string, boolean | string | Price) => void, setDaemonSetting: (string, ?SetDaemonSettingArg) => void,
setClientSetting: (string, boolean | string | number | Price) => void, setClientSetting: (string, SetDaemonSettingArg | number) => void,
clearCache: () => Promise<any>, clearCache: () => Promise<any>,
getThemes: () => void, getThemes: () => void,
daemonSettings: DaemonSettings, daemonSettings: DaemonSettings,
@ -93,7 +95,7 @@ class SettingsPage extends React.PureComponent<Props, State> {
onKeyFeeDisableChange(isDisabled: boolean) { onKeyFeeDisableChange(isDisabled: boolean) {
this.props.setClientSetting(SETTINGS.DISABLE_MAX_KEY_FEE, isDisabled); this.props.setClientSetting(SETTINGS.DISABLE_MAX_KEY_FEE, isDisabled);
// null is default value passed to clear key fee // null is default value passed to clear key fee
if (isDisabled) this.setDaemonSetting('max_key_fee', ''); if (isDisabled) this.setDaemonSetting('max_key_fee');
} }
onThemeChange(event: SyntheticInputEvent<*>) { onThemeChange(event: SyntheticInputEvent<*>) {
@ -143,7 +145,7 @@ class SettingsPage extends React.PureComponent<Props, State> {
this.props.setClientSetting(SETTINGS.OS_NOTIFICATIONS_ENABLED, event.target.checked); this.props.setClientSetting(SETTINGS.OS_NOTIFICATIONS_ENABLED, event.target.checked);
} }
setDaemonSetting(name: string, value: boolean | string | Price | ''): void { setDaemonSetting(name: string, value: ?SetDaemonSettingArg): void {
this.props.setDaemonSetting(name, value); this.props.setDaemonSetting(name, value);
} }