From 2cf7eef9d7e43ed93d5a3d9b4ca8256d0436488a Mon Sep 17 00:00:00 2001 From: jessop Date: Thu, 19 Dec 2019 17:35:12 -0500 Subject: [PATCH] correctly checks savedPassword based on keychain --- static/app-strings.json | 5 +++-- ui/page/settings/view.jsx | 7 +++---- ui/util/saved-passwords.js | 5 +++++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/static/app-strings.json b/static/app-strings.json index 3f746dd52..016010c8b 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -935,5 +935,6 @@ "Copy": "Copy", "Text copied": "Text copied", "Rewards Disabled": "Rewards Disabled", - "Woah, you have a lot of friends! You've claimed the maximum amount of referral rewards. Check back soon to see if more are available!.": "Woah, you have a lot of friends! You've claimed the maximum amount of referral rewards. Check back soon to see if more are available!." -} + "Woah, you have a lot of friends! You've claimed the maximum amount of referral rewards. Check back soon to see if more are available!.": "Woah, you have a lot of friends! You've claimed the maximum amount of referral rewards. Check back soon to see if more are available!.", + "Wallet servers are used to relay data to and from the LBRY blockchain. They also determine what content shows in trending or is blocked. %learn_more%.": "Wallet servers are used to relay data to and from the LBRY blockchain. They also determine what content shows in trending or is blocked. %learn_more%." +} \ No newline at end of file diff --git a/ui/page/settings/view.jsx b/ui/page/settings/view.jsx index b20d6933c..9390bd3a8 100644 --- a/ui/page/settings/view.jsx +++ b/ui/page/settings/view.jsx @@ -16,7 +16,7 @@ import SettingAutoLaunch from 'component/settingAutoLaunch'; import FileSelector from 'component/common/file-selector'; import SyncToggle from 'component/syncToggle'; import Card from 'component/common/card'; -import { getSavedPassword } from 'util/saved-passwords'; +import { getKeychainPassword } from 'util/saved-passwords'; // @if TARGET='app' export const IS_MAC = process.platform === 'darwin'; @@ -105,9 +105,8 @@ class SettingsPage extends React.PureComponent { const { isAuthenticated } = this.props; if (isAuthenticated) { this.props.updateWalletStatus(); - - getSavedPassword().then(p => { - if (p) { + getKeychainPassword().then(p => { + if (typeof p === 'string') { this.setState({ storedPassword: true }); } }); diff --git a/ui/util/saved-passwords.js b/ui/util/saved-passwords.js index 87df1c51d..e3a83d8c8 100644 --- a/ui/util/saved-passwords.js +++ b/ui/util/saved-passwords.js @@ -78,7 +78,12 @@ export const getSavedPassword = () => { if (sessionPassword) { resolve(sessionPassword); } + return getKeychainPassword().then(p => p); + }); +}; +export const getKeychainPassword = () => { + return new Promise<*>(resolve => { // @if TARGET='app' ipcRenderer.once('get-password-response', (event, password) => { resolve(password);