rebase and comment out keytar
This commit is contained in:
parent
30d396fce9
commit
ec1f48484e
7 changed files with 35 additions and 27 deletions
|
@ -1,7 +1,7 @@
|
|||
// @flow
|
||||
import React from 'react';
|
||||
import { Modal } from 'modal/modal';
|
||||
import keytar from 'keytar';
|
||||
// import keytar from 'keytar';
|
||||
|
||||
type Props = {
|
||||
closeModal: () => void,
|
||||
|
@ -18,11 +18,12 @@ class ModalPasswordUnsave extends React.PureComponent<Props> {
|
|||
type="confirm"
|
||||
confirmButtonLabel={__('Forget')}
|
||||
abortButtonLabel={__('Nevermind')}
|
||||
onConfirmed={() =>
|
||||
keytar.deletePassword('LBRY', 'wallet_password').then(() => {
|
||||
this.props.setPasswordSaved(false);
|
||||
this.props.closeModal();
|
||||
})
|
||||
onConfirmed={
|
||||
() => {}
|
||||
// keytar.deletePassword('LBRY', 'wallet_password').then(() => {
|
||||
// this.props.setPasswordSaved(false);
|
||||
// this.props.closeModal();
|
||||
// })
|
||||
}
|
||||
onAborted={this.props.closeModal}
|
||||
>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import React from 'react';
|
||||
import { Modal } from 'modal/modal';
|
||||
import Button from 'component/button';
|
||||
import keytar from 'keytar';
|
||||
// import keytar from 'keytar';
|
||||
|
||||
type Props = {
|
||||
closeModal: () => void,
|
||||
|
@ -26,7 +26,7 @@ class ModalWalletDecrypt extends React.PureComponent<Props, State> {
|
|||
const { props, state } = this;
|
||||
|
||||
if (state.submitted && props.walletDecryptSucceded === true) {
|
||||
keytar.deletePassword('LBRY', 'wallet_password');
|
||||
// keytar.deletePassword('LBRY', 'wallet_password');
|
||||
props.setPasswordSaved(false);
|
||||
props.closeModal();
|
||||
props.updateWalletStatus();
|
||||
|
|
|
@ -3,7 +3,6 @@ import React from 'react';
|
|||
import { Form, FormField, Submit } from 'component/common/form';
|
||||
import { Modal } from 'modal/modal';
|
||||
import Button from 'component/button';
|
||||
import keytar from 'keytar';
|
||||
|
||||
type Props = {
|
||||
closeModal: () => void,
|
||||
|
@ -89,7 +88,7 @@ class ModalWalletEncrypt extends React.PureComponent<Props, State> {
|
|||
}
|
||||
if (state.rememberPassword === true) {
|
||||
this.props.setPasswordSaved(true);
|
||||
keytar.setPassword('LBRY', 'wallet_password', state.newPassword);
|
||||
// keytar.setPassword('LBRY', 'wallet_password', state.newPassword);
|
||||
}
|
||||
this.setState({ submitted: true });
|
||||
this.props.encryptWallet(state.newPassword);
|
||||
|
|
|
@ -3,7 +3,7 @@ import React from 'react';
|
|||
import { Form, FormField } from 'component/common/form';
|
||||
import { Modal } from 'modal/modal';
|
||||
import Button from 'component/button';
|
||||
import keytar from 'keytar';
|
||||
// import keytar from 'keytar';
|
||||
|
||||
type Props = {
|
||||
quit: () => void,
|
||||
|
@ -30,7 +30,7 @@ class ModalWalletUnlock extends React.PureComponent<Props, State> {
|
|||
if (props.walletUnlockSucceded === true) {
|
||||
if (this.state.rememberPassword) {
|
||||
this.props.setPasswordSaved(true);
|
||||
keytar.setPassword('LBRY', 'wallet_password', this.state.password);
|
||||
// keytar.setPassword('LBRY', 'wallet_password', this.state.password);
|
||||
}
|
||||
props.closeModal();
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import Page from 'component/page';
|
|||
import SettingLanguage from 'component/settingLanguage';
|
||||
import FileSelector from 'component/common/file-selector';
|
||||
import UnsupportedOnWeb from 'component/common/unsupported-on-web';
|
||||
import keytar from 'keytar';
|
||||
// import keytar from 'keytar';
|
||||
import WalletSecurityAndSync from '../../component/walletSecurityAndSync';
|
||||
|
||||
type Price = {
|
||||
|
@ -99,13 +99,13 @@ class SettingsPage extends React.PureComponent<Props, State> {
|
|||
componentDidMount() {
|
||||
this.props.getThemes();
|
||||
this.props.updateWalletStatus();
|
||||
keytar.getPassword('LBRY', 'wallet_password').then(p => {
|
||||
if (p || p === '') {
|
||||
this.props.setPasswordSaved(true);
|
||||
} else {
|
||||
this.props.setPasswordSaved(false);
|
||||
}
|
||||
});
|
||||
// keytar.getPassword('LBRY', 'wallet_password').then(p => {
|
||||
// if (p || p === '') {
|
||||
// this.props.setPasswordSaved(true);
|
||||
// } else {
|
||||
// this.props.setPasswordSaved(false);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
onKeyFeeChange(newValue: Price) {
|
||||
|
|
|
@ -14,8 +14,14 @@ const select = (state, props) => {
|
|||
const { pathname, hash } = props.location;
|
||||
const urlPath = pathname + hash;
|
||||
// Remove the leading "/" added by the browser
|
||||
<<<<<<< HEAD
|
||||
const path = urlPath.slice(1).replace(/:/g, '#');
|
||||
|
||||
=======
|
||||
const path = pathname.slice(1).replace(/:/g, '#');
|
||||
console.log('path', path);
|
||||
debugger;
|
||||
>>>>>>> rebase and comment out keytar
|
||||
let uri;
|
||||
try {
|
||||
uri = normalizeURI(path);
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
import keytar from 'keytar';
|
||||
// import keytar from 'keytar';
|
||||
import { AUTH_ORG } from 'constants/keychain';
|
||||
|
||||
export const setSavedPassword = (key, value) => {
|
||||
keytar.setPassword(AUTH_ORG, key, value);
|
||||
// keytar.setPassword(AUTH_ORG, key, value);
|
||||
};
|
||||
|
||||
export const getSavedPassword = key => {
|
||||
return keytar
|
||||
.getPassword(AUTH_ORG, key)
|
||||
.then(p => p)
|
||||
.catch(e => console.error(e));
|
||||
// return keytar
|
||||
// .getPassword(AUTH_ORG, key)
|
||||
// .then(p => p)
|
||||
// .catch(e => console.error(e));
|
||||
};
|
||||
|
||||
export const deleteSavedPassword = key => keytar.deletePassword(AUTH_ORG, key).catch(e => console.error(e));
|
||||
export const deleteSavedPassword = key => {
|
||||
// keytar.deletePassword(AUTH_ORG, key).catch(e => console.error(e));
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue