review fixes

Set disableMaxKeyFee as a local variable. Removed file info from componentdidmount.
This commit is contained in:
Thomas Zarebczan 2019-02-11 19:05:11 -05:00
parent ffb4bf46cc
commit 7546f30f96
4 changed files with 3 additions and 6 deletions

View file

@ -17,5 +17,4 @@ export const AUTOPLAY = 'autoplay';
export const RESULT_COUNT = 'resultCount'; export const RESULT_COUNT = 'resultCount';
export const OS_NOTIFICATIONS_ENABLED = 'osNotificationsEnabled'; export const OS_NOTIFICATIONS_ENABLED = 'osNotificationsEnabled';
export const AUTO_DOWNLOAD = 'autoDownload'; export const AUTO_DOWNLOAD = 'autoDownload';
export const DISABLE_MAX_KEY_FEE = 'disableMaxKeyFee';
export const LOCAL_MAX_KEY_FEE = 'localMaxKeyFee'; export const LOCAL_MAX_KEY_FEE = 'localMaxKeyFee';

View file

@ -58,8 +58,7 @@ class FilePage extends React.Component<Props> {
]; ];
componentDidMount() { componentDidMount() {
// eslint-disable-next-line no-unused-vars const { uri, fetchFileInfo, fetchCostInfo, setViewed, isSubscribed } = this.props;
const { uri, fileInfo, fetchFileInfo, fetchCostInfo, setViewed, isSubscribed } = this.props;
if (isSubscribed) { if (isSubscribed) {
this.removeFromSubscriptionNotifications(); this.removeFromSubscriptionNotifications();

View file

@ -31,7 +31,6 @@ const select = state => ({
walletEncrypted: selectWalletIsEncrypted(state), walletEncrypted: selectWalletIsEncrypted(state),
osNotificationsEnabled: selectosNotificationsEnabled(state), osNotificationsEnabled: selectosNotificationsEnabled(state),
autoDownload: makeSelectClientSetting(settings.AUTO_DOWNLOAD)(state), autoDownload: makeSelectClientSetting(settings.AUTO_DOWNLOAD)(state),
disableMaxKeyFee: makeSelectClientSetting(settings.DISABLE_MAX_KEY_FEE)(state),
localMaxKeyFee: makeSelectClientSetting(settings.LOCAL_MAX_KEY_FEE)(state), localMaxKeyFee: makeSelectClientSetting(settings.LOCAL_MAX_KEY_FEE)(state),
}); });

View file

@ -39,7 +39,6 @@ type Props = {
updateWalletStatus: () => void, updateWalletStatus: () => void,
walletEncrypted: boolean, walletEncrypted: boolean,
osNotificationsEnabled: boolean, osNotificationsEnabled: boolean,
disableMaxKeyFee: boolean,
localMaxKeyFee: Price, localMaxKeyFee: Price,
}; };
@ -175,13 +174,14 @@ class SettingsPage extends React.PureComponent<Props, State> {
walletEncrypted, walletEncrypted,
osNotificationsEnabled, osNotificationsEnabled,
autoDownload, autoDownload,
disableMaxKeyFee,
localMaxKeyFee, localMaxKeyFee,
} = this.props; } = this.props;
const noDaemonSettings = !daemonSettings || Object.keys(daemonSettings).length === 0; const noDaemonSettings = !daemonSettings || Object.keys(daemonSettings).length === 0;
const isDarkModeEnabled = currentTheme === 'dark'; const isDarkModeEnabled = currentTheme === 'dark';
const disableMaxKeyFee = !(daemonSettings && daemonSettings.max_key_fee);
return ( return (
<Page> <Page>
{noDaemonSettings ? ( {noDaemonSettings ? (