From 7546f30f964862b561fb0f8fc93d5fd09417d0e5 Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Mon, 11 Feb 2019 19:05:11 -0500 Subject: [PATCH] review fixes Set disableMaxKeyFee as a local variable. Removed file info from componentdidmount. --- src/renderer/constants/settings.js | 1 - src/renderer/page/file/view.jsx | 3 +-- src/renderer/page/settings/index.js | 1 - src/renderer/page/settings/view.jsx | 4 ++-- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/renderer/constants/settings.js b/src/renderer/constants/settings.js index 2e9c49a9f..e4c940f64 100644 --- a/src/renderer/constants/settings.js +++ b/src/renderer/constants/settings.js @@ -17,5 +17,4 @@ export const AUTOPLAY = 'autoplay'; export const RESULT_COUNT = 'resultCount'; export const OS_NOTIFICATIONS_ENABLED = 'osNotificationsEnabled'; export const AUTO_DOWNLOAD = 'autoDownload'; -export const DISABLE_MAX_KEY_FEE = 'disableMaxKeyFee'; export const LOCAL_MAX_KEY_FEE = 'localMaxKeyFee'; diff --git a/src/renderer/page/file/view.jsx b/src/renderer/page/file/view.jsx index 9ae5a7a85..e106576a2 100644 --- a/src/renderer/page/file/view.jsx +++ b/src/renderer/page/file/view.jsx @@ -58,8 +58,7 @@ class FilePage extends React.Component { ]; componentDidMount() { - // eslint-disable-next-line no-unused-vars - const { uri, fileInfo, fetchFileInfo, fetchCostInfo, setViewed, isSubscribed } = this.props; + const { uri, fetchFileInfo, fetchCostInfo, setViewed, isSubscribed } = this.props; if (isSubscribed) { this.removeFromSubscriptionNotifications(); diff --git a/src/renderer/page/settings/index.js b/src/renderer/page/settings/index.js index 46ee4e029..4c4051e5a 100644 --- a/src/renderer/page/settings/index.js +++ b/src/renderer/page/settings/index.js @@ -31,7 +31,6 @@ const select = state => ({ walletEncrypted: selectWalletIsEncrypted(state), osNotificationsEnabled: selectosNotificationsEnabled(state), autoDownload: makeSelectClientSetting(settings.AUTO_DOWNLOAD)(state), - disableMaxKeyFee: makeSelectClientSetting(settings.DISABLE_MAX_KEY_FEE)(state), localMaxKeyFee: makeSelectClientSetting(settings.LOCAL_MAX_KEY_FEE)(state), }); diff --git a/src/renderer/page/settings/view.jsx b/src/renderer/page/settings/view.jsx index 246319ff2..ac90b0fdf 100644 --- a/src/renderer/page/settings/view.jsx +++ b/src/renderer/page/settings/view.jsx @@ -39,7 +39,6 @@ type Props = { updateWalletStatus: () => void, walletEncrypted: boolean, osNotificationsEnabled: boolean, - disableMaxKeyFee: boolean, localMaxKeyFee: Price, }; @@ -175,13 +174,14 @@ class SettingsPage extends React.PureComponent { walletEncrypted, osNotificationsEnabled, autoDownload, - disableMaxKeyFee, localMaxKeyFee, } = this.props; const noDaemonSettings = !daemonSettings || Object.keys(daemonSettings).length === 0; const isDarkModeEnabled = currentTheme === 'dark'; + const disableMaxKeyFee = !(daemonSettings && daemonSettings.max_key_fee); + return ( {noDaemonSettings ? (