From 21749453df3ad67dbb80ac85a410898f9b622b6c Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Mon, 10 Feb 2020 11:58:51 +0100 Subject: [PATCH 1/2] dht setting --- src/constants.js | 1 + src/page/settings/index.js | 3 ++- src/page/settings/view.js | 21 ++++++++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) 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); + }} + /> + + ); -- 2.45.2 From 1a638e88e4c39ef529912ee33950ed6aef93eba6 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 13 Mar 2020 17:02:53 +0100 Subject: [PATCH 2/2] update setting text --- android | 2 +- src/page/settings/index.js | 7 ++----- src/page/settings/view.js | 10 +++++----- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/android b/android index 37b8931..ea8ac78 160000 --- a/android +++ b/android @@ -1 +1 @@ -Subproject commit 37b893103da874282f2bdef4a8a1bb543d2c9859 +Subproject commit ea8ac783a8b05db8ab78472efc3fff32dc6869e6 diff --git a/src/page/settings/index.js b/src/page/settings/index.js index 8da8c2c..f5353a4 100644 --- a/src/page/settings/index.js +++ b/src/page/settings/index.js @@ -11,7 +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), + enableDht: makeSelectClientSetting(Constants.SETTING_DHT_ENABLED)(state), keepDaemonRunning: makeSelectClientSetting(SETTINGS.KEEP_DAEMON_RUNNING)(state), language: makeSelectClientSetting(SETTINGS.LANGUAGE)(state), showNsfw: makeSelectClientSetting(SETTINGS.SHOW_NSFW)(state), @@ -30,7 +30,4 @@ const perform = dispatch => ({ setPlayerVisible: () => dispatch(doSetPlayerVisible(false)), }); -export default connect( - select, - perform, -)(SettingsPage); +export default connect(select, perform)(SettingsPage); diff --git a/src/page/settings/view.js b/src/page/settings/view.js index 6c92c85..df63fab 100644 --- a/src/page/settings/view.js +++ b/src/page/settings/view.js @@ -158,7 +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); + const actualEnableDht = this.getBooleanSetting(enableDht, false); return ( @@ -315,16 +315,16 @@ class SettingsPage extends React.PureComponent { - {__('Enable DHT')} + {__('Participate in the data network')} - {__('Participate in the data network (requires app and service restart)')} + {__('Enable DHT (this will take effect upon app and background service restart)')} { - this.setNativeBooleanSetting(SETTINGS.SETTING_DHT_ENABLED, value); + this.setNativeBooleanSetting(Constants.SETTING_DHT_ENABLED, value); }} /> -- 2.45.2