correctly checks savedPassword based on keychain

This commit is contained in:
jessop 2019-12-19 17:35:12 -05:00 committed by Sean Yesmunt
parent e7bd302fac
commit 2cf7eef9d7
3 changed files with 11 additions and 6 deletions

View file

@ -935,5 +935,6 @@
"Copy": "Copy", "Copy": "Copy",
"Text copied": "Text copied", "Text copied": "Text copied",
"Rewards Disabled": "Rewards Disabled", "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%."
}

View file

@ -16,7 +16,7 @@ import SettingAutoLaunch from 'component/settingAutoLaunch';
import FileSelector from 'component/common/file-selector'; import FileSelector from 'component/common/file-selector';
import SyncToggle from 'component/syncToggle'; import SyncToggle from 'component/syncToggle';
import Card from 'component/common/card'; import Card from 'component/common/card';
import { getSavedPassword } from 'util/saved-passwords'; import { getKeychainPassword } from 'util/saved-passwords';
// @if TARGET='app' // @if TARGET='app'
export const IS_MAC = process.platform === 'darwin'; export const IS_MAC = process.platform === 'darwin';
@ -105,9 +105,8 @@ class SettingsPage extends React.PureComponent<Props, State> {
const { isAuthenticated } = this.props; const { isAuthenticated } = this.props;
if (isAuthenticated) { if (isAuthenticated) {
this.props.updateWalletStatus(); this.props.updateWalletStatus();
getKeychainPassword().then(p => {
getSavedPassword().then(p => { if (typeof p === 'string') {
if (p) {
this.setState({ storedPassword: true }); this.setState({ storedPassword: true });
} }
}); });

View file

@ -78,7 +78,12 @@ export const getSavedPassword = () => {
if (sessionPassword) { if (sessionPassword) {
resolve(sessionPassword); resolve(sessionPassword);
} }
return getKeychainPassword().then(p => p);
});
};
export const getKeychainPassword = () => {
return new Promise<*>(resolve => {
// @if TARGET='app' // @if TARGET='app'
ipcRenderer.once('get-password-response', (event, password) => { ipcRenderer.once('get-password-response', (event, password) => {
resolve(password); resolve(password);