diff --git a/src/constants.js b/src/constants.js index 7c508d3..fb980c9 100644 --- a/src/constants.js +++ b/src/constants.js @@ -44,6 +44,7 @@ const Constants = { SETTING_BACKUP_DISMISSED: 'backupDismissed', SETTING_REWARDS_NOT_INTERESTED: 'rewardsNotInterested', SETTING_DEVICE_WALLET_SYNCED: 'deviceWalletSynced', + SETTING_DHT_ENABLED: 'dhtEnabled', ACTION_DELETE_COMPLETED_BLOBS: 'DELETE_COMPLETED_BLOBS', ACTION_FIRST_RUN_PAGE_CHANGED: 'FIRST_RUN_PAGE_CHANGED', diff --git a/src/page/settings/index.js b/src/page/settings/index.js index 01bd9d4..8da8c2c 100644 --- a/src/page/settings/index.js +++ b/src/page/settings/index.js @@ -11,6 +11,7 @@ const select = state => ({ backgroundPlayEnabled: makeSelectClientSetting(SETTINGS.BACKGROUND_PLAY_ENABLED)(state), currentRoute: selectCurrentRoute(state), drawerStack: selectDrawerStack(state), + enableDht: makeSelectClientSetting(SETTINGS.SETTING_DHT_ENABLED)(state), keepDaemonRunning: makeSelectClientSetting(SETTINGS.KEEP_DAEMON_RUNNING)(state), language: makeSelectClientSetting(SETTINGS.LANGUAGE)(state), showNsfw: makeSelectClientSetting(SETTINGS.SHOW_NSFW)(state), @@ -31,5 +32,5 @@ const perform = dispatch => ({ export default connect( select, - perform + perform, )(SettingsPage); diff --git a/src/page/settings/view.js b/src/page/settings/view.js index 53bcd25..6c92c85 100644 --- a/src/page/settings/view.js +++ b/src/page/settings/view.js @@ -140,6 +140,7 @@ class SettingsPage extends React.PureComponent { render() { const { backgroundPlayEnabled, + enableDht, keepDaemonRunning, receiveSubscriptionNotifications, receiveRewardNotifications, @@ -157,6 +158,7 @@ class SettingsPage extends React.PureComponent { const actualReceiveRewardNotifications = this.getBooleanSetting(receiveRewardNotifications, true); const actualReceiveInterestsNotifications = this.getBooleanSetting(receiveInterestsNotifications, true); const actualReceiveCreatorNotifications = this.getBooleanSetting(receiveCreatorNotifications, true); + const actualEnableDht = this.getBooleanSetting(enableDht, true); return ( @@ -294,7 +296,7 @@ class SettingsPage extends React.PureComponent { {__( - 'Enable this option for quicker app launch and to keep the synchronisation with the blockchain up to date.' + 'Enable this option for quicker app launch and to keep the synchronisation with the blockchain up to date.', )} @@ -310,6 +312,23 @@ class SettingsPage extends React.PureComponent { /> + + + + {__('Enable DHT')} + + {__('Participate in the data network (requires app and service restart)')} + + + + { + this.setNativeBooleanSetting(SETTINGS.SETTING_DHT_ENABLED, value); + }} + /> + + );