OSDN Git Service

remove code to export private key
authorYongfeng LI <wliyongfeng@gmail.com>
Wed, 18 Apr 2018 02:47:03 +0000 (10:47 +0800)
committerYongfeng LI <wliyongfeng@gmail.com>
Wed, 18 Apr 2018 02:47:03 +0000 (10:47 +0800)
src/features/mockhsm/components/List.jsx
src/features/mockhsm/components/Show.jsx
src/features/mockhsm/reducers.js

index 799b47f..b867412 100644 (file)
@@ -1,32 +1,9 @@
 import { BaseList, TableList } from 'features/shared/components'
 import ListItem from './ListItem'
-import { chainClient } from 'utility/environment'
-import { store } from 'app'
 
 const type = 'key'
 
 class KeyList extends BaseList.ItemList {
-  constructor(props) {
-    super(props)
-    const client = chainClient()
-
-    this.setStat = () => client.mockHsm.keys.progress().then(({data}) => {
-      store.dispatch({
-        type: 'RECEIVED_IMPORT_STATUS',
-        data
-      })
-
-      const isImporting = item => {
-        return typeof item.percent === 'number' && item.percent < 100
-      }
-
-      if ((data || []).filter(isImporting).length > 0) {
-        window.setTimeout(this.setStat, 5000)
-      }
-    })
-
-    this.setStat()
-  }
 }
 
 export default BaseList.connect(
index 4b700e0..a011d42 100644 (file)
@@ -50,7 +50,6 @@ class Show extends BaseShow {
             object='key'
             title={lang === 'zh' ? '详情' : 'Details'}
             actions={[
-              <button key='show-exportkey' className='btn btn-link' onClick={this.showExportKey.bind(this, item, lang)}> {lang === 'zh' ? '导出私钥' : 'Export Private Key' }</button>,
               <Link key='reset-password-btn' className='btn btn-link' to={`/keys/${item.id}/reset-password`}>{lang === 'zh' ? '重置密码' : 'Reset Password' }</Link>
             ]}
             items={[
index f2683b9..e60cb7c 100644 (file)
@@ -4,17 +4,8 @@ import { combineReducers } from 'redux'
 const type = 'key'
 const idFunc = item => item.xpub
 
-const importStatusReducer = (state = [], action) => {
-  if (action.type === 'RECEIVED_IMPORT_STATUS') {
-    return action.data
-  }
-
-  return state
-}
-
 export default combineReducers({
   items: reducers.itemsReducer(type, idFunc),
   queries: reducers.queriesReducer(type, idFunc),
   autocompleteIsLoaded: reducers.autocompleteIsLoadedReducer(type),
-  importStatus: importStatusReducer,
 })