From 51e3dfcf6a240fc2575edbf5f4860c42729c10d4 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 1 Nov 2019 06:52:39 +0100 Subject: [PATCH] show notification settings. handle blackListedOutpoints being null. --- src/component/fileItem/view.js | 4 +- src/component/fileListItem/view.js | 4 +- src/page/settings/view.js | 94 ++++++++++++++---------------- src/page/splash/view.js | 5 +- 4 files changed, 55 insertions(+), 52 deletions(-) diff --git a/src/component/fileItem/view.js b/src/component/fileItem/view.js index cf2db92..6e5235d 100644 --- a/src/component/fileItem/view.js +++ b/src/component/fileItem/view.js @@ -66,7 +66,9 @@ class FileItem extends React.PureComponent { let shouldHide = false; if (blackListedOutpoints || filteredOutpoints) { - const outpointsToHide = blackListedOutpoints.concat(filteredOutpoints); + const outpointsToHide = !blackListedOutpoints + ? filteredOutpoints + : blackListedOutpoints.concat(filteredOutpoints); shouldHide = outpointsToHide.some(outpoint => outpoint.txid === claim.txid && outpoint.nout === claim.nout); } if (shouldHide) { diff --git a/src/component/fileListItem/view.js b/src/component/fileListItem/view.js index c2faa83..48f2c4d 100644 --- a/src/component/fileListItem/view.js +++ b/src/component/fileListItem/view.js @@ -120,7 +120,9 @@ class FileListItem extends React.PureComponent { shortChannelUri = signingChannel ? signingChannel.short_url : null; if (blackListedOutpoints || filteredOutpoints) { - const outpointsToHide = blackListedOutpoints.concat(filteredOutpoints); + const outpointsToHide = !blackListedOutpoints + ? filteredOutpoints + : blackListedOutpoints.concat(filteredOutpoints); shouldHide = outpointsToHide.some(outpoint => outpoint.txid === claim.txid && outpoint.nout === claim.nout); } diff --git a/src/page/settings/view.js b/src/page/settings/view.js index 2b17b86..7272461 100644 --- a/src/page/settings/view.js +++ b/src/page/settings/view.js @@ -105,56 +105,52 @@ class SettingsPage extends React.PureComponent { - {false && ( - - - {__('Notifications')} - - {__('Choose the notifications you would like to receive.')} - - - - {__('Subscriptions')} - - - { - this.setNativeBooleanSetting(SETTINGS.RECEIVE_SUBSCRIPTION_NOTIFICATIONS, value); - }} - /> - - - - - - {__('Rewards')} - - - { - this.setNativeBooleanSetting(SETTINGS.RECEIVE_REWARD_NOTIFICATIONS, value); - }} - /> - - - - - - {__('Tags you follow')} - - - { - this.setNativeBooleanSetting(SETTINGS.RECEIVE_INTERESTS_NOTIFICATIONS, value); - }} - /> - - + + {__('Notifications')} + + {__('Choose the notifications you would like to receive.')} + + + + {__('Subscriptions')} - )} + + { + this.setNativeBooleanSetting(SETTINGS.RECEIVE_SUBSCRIPTION_NOTIFICATIONS, value); + }} + /> + + + + + + {__('Rewards')} + + + { + this.setNativeBooleanSetting(SETTINGS.RECEIVE_REWARD_NOTIFICATIONS, value); + }} + /> + + + + + + {__('Content Interests')} + + + { + this.setNativeBooleanSetting(SETTINGS.RECEIVE_INTERESTS_NOTIFICATIONS, value); + }} + /> + + {false && ( diff --git a/src/page/splash/view.js b/src/page/splash/view.js index 4aa5615..e288417 100644 --- a/src/page/splash/view.js +++ b/src/page/splash/view.js @@ -158,7 +158,10 @@ class SplashScreen extends React.PureComponent { NativeModules.VersionInfo.getAppVersion().then(appVersion => { this.setState({ shouldAuthenticate: true }); NativeModules.Firebase.getMessagingToken() - .then(firebaseToken => authenticate(appVersion, Platform.OS, firebaseToken)) + .then(firebaseToken => { + console.log(firebaseToken); + authenticate(appVersion, Platform.OS, firebaseToken); + }) .catch(() => authenticate(appVersion, Platform.OS)); }); } -- 2.45.2