From 1b14afbd7de417e94a5e12b9b83b59746bfb3d68 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 8 Feb 2019 03:59:41 -0500 Subject: [PATCH] flow fix --- src/renderer/page/settings/view.jsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/renderer/page/settings/view.jsx b/src/renderer/page/settings/view.jsx index 6037653fc..246319ff2 100644 --- a/src/renderer/page/settings/view.jsx +++ b/src/renderer/page/settings/view.jsx @@ -12,6 +12,8 @@ export type Price = { amount: number, }; +type SetDaemonSettingArg = boolean | string | Price; + type DaemonSettings = { download_dir: string, share_usage_data: boolean, @@ -19,8 +21,8 @@ type DaemonSettings = { }; type Props = { - setDaemonSetting: (string, boolean | string | Price) => void, - setClientSetting: (string, boolean | string | number | Price) => void, + setDaemonSetting: (string, ?SetDaemonSettingArg) => void, + setClientSetting: (string, SetDaemonSettingArg | number) => void, clearCache: () => Promise, getThemes: () => void, daemonSettings: DaemonSettings, @@ -93,7 +95,7 @@ class SettingsPage extends React.PureComponent { onKeyFeeDisableChange(isDisabled: boolean) { this.props.setClientSetting(SETTINGS.DISABLE_MAX_KEY_FEE, isDisabled); // 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<*>) { @@ -143,7 +145,7 @@ class SettingsPage extends React.PureComponent { 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); }