@ -1955,7 +1955,7 @@ function editRpc (oldRpc, newRpc, chainId, ticker = 'ETH', nickname, rpcPrefs) {
background . delCustomRpc ( oldRpc , ( err ) => {
background . delCustomRpc ( oldRpc , ( err ) => {
if ( err ) {
if ( err ) {
log . error ( err )
log . error ( err )
return dispatch ( self . displayWarning ( 'Had a problem removing network!' ) )
return dispatch ( action s. displayWarning ( 'Had a problem removing network!' ) )
}
}
dispatch ( actions . setSelectedToken ( ) )
dispatch ( actions . setSelectedToken ( ) )
background . updateAndSetCustomRpc ( newRpc , chainId , ticker , nickname || newRpc , rpcPrefs , ( err ) => {
background . updateAndSetCustomRpc ( newRpc , chainId , ticker , nickname || newRpc , rpcPrefs , ( err ) => {
@ -1992,7 +1992,7 @@ function delRpcTarget (oldRpc) {
background . delCustomRpc ( oldRpc , ( err ) => {
background . delCustomRpc ( oldRpc , ( err ) => {
if ( err ) {
if ( err ) {
log . error ( err )
log . error ( err )
dispatch ( self . displayWarning ( 'Had a problem removing network!' ) )
dispatch ( action s. displayWarning ( 'Had a problem removing network!' ) )
return reject ( err )
return reject ( err )
}
}
dispatch ( actions . setSelectedToken ( ) )
dispatch ( actions . setSelectedToken ( ) )
@ -2180,32 +2180,29 @@ function requestExportAccount () {
}
}
function exportAccount ( password , address ) {
function exportAccount ( password , address ) {
const self = this
return function ( dispatch ) {
return function ( dispatch ) {
dispatch ( self . showLoadingIndication ( ) )
dispatch ( actions . showLoadingIndication ( ) )
log . debug ( ` background.submitPassword ` )
log . debug ( ` background.submitPassword ` )
return new Promise ( ( resolve , reject ) => {
return new Promise ( ( resolve , reject ) => {
background . submitPassword ( password , function ( err ) {
background . submitPassword ( password , function ( err ) {
if ( err ) {
if ( err ) {
log . error ( 'Error in submiting password.' )
log . error ( 'Error in submiting password.' )
dispatch ( self . hideLoadingIndication ( ) )
dispatch ( action s. hideLoadingIndication ( ) )
dispatch ( self . displayWarning ( 'Incorrect Password.' ) )
dispatch ( action s. displayWarning ( 'Incorrect Password.' ) )
return reject ( err )
return reject ( err )
}
}
log . debug ( ` background.exportAccount ` )
log . debug ( ` background.exportAccount ` )
return background . exportAccount ( address , function ( err , result ) {
return background . exportAccount ( address , function ( err , result ) {
dispatch ( self . hideLoadingIndication ( ) )
dispatch ( action s. hideLoadingIndication ( ) )
if ( err ) {
if ( err ) {
log . error ( err )
log . error ( err )
dispatch ( self . displayWarning ( 'Had a problem exporting the account.' ) )
dispatch ( action s. displayWarning ( 'Had a problem exporting the account.' ) )
return reject ( err )
return reject ( err )
}
}
// dispatch(self.exportAccountComplete())
dispatch ( actions . showPrivateKey ( result ) )
dispatch ( self . showPrivateKey ( result ) )
return resolve ( result )
return resolve ( result )
} )
} )