correctly checks savedPassword based on keychain
This commit is contained in:
parent
e7bd302fac
commit
2cf7eef9d7
3 changed files with 11 additions and 6 deletions
|
@ -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%."
|
||||
}
|
|
@ -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<Props, State> {
|
|||
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 });
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue