• R/O
  • HTTP
  • SSH
  • HTTPS

bytom-dashboard: Commit

dashboard of Bytom


Commit MetaInfo

Revision45a49924707059707b05b5ea828ca5d509fe96fa (tree)
Zeit2018-07-30 20:47:18
AutorZhiting Lin <zlin035@uott...>
CommiterZhiting Lin

Log Message

Modified the password locked for 5 mins.

Ändern Zusammenfassung

Diff

--- a/src/features/transactions/actions.js
+++ b/src/features/transactions/actions.js
@@ -99,26 +99,6 @@ function preprocessTransaction(formParams) {
9999 form.submitForm = (formParams) => function (dispatch) {
100100 const client = chainClient()
101101
102- const buildPromise = (formParams.state.showAdvanced && formParams.signTransaction) ? null :
103- client.transactions.build(builder => {
104- const processed = preprocessTransaction(formParams)
105-
106- builder.actions = processed.actions
107- if (processed.baseTransaction) {
108- builder.baseTransaction = processed.baseTransaction
109- }
110- })
111-
112- const submitSucceeded = () => {
113- dispatch(form.created())
114- dispatch(push({
115- pathname: '/transactions',
116- state: {
117- preserveFlash: true
118- }
119- }))
120- }
121-
122102 const checkIfFormChanged = () =>{
123103 const lastFormParms = formParams.tpl && JSON.parse(formParams.tpl.formParams)
124104 const copy = JSON.parse(JSON.stringify(formParams))
@@ -141,6 +121,28 @@ form.submitForm = (formParams) => function (dispatch) {
141121 return isPasswordChangeOnly
142122 }
143123
124+ const isPasswordChangeOnly = (formParams.tpl !== '' && checkIfFormChanged())
125+
126+ const buildPromise = ((formParams.state.showAdvanced && formParams.signTransaction) || isPasswordChangeOnly) ? null :
127+ client.transactions.build(builder => {
128+ const processed = preprocessTransaction(formParams)
129+
130+ builder.actions = processed.actions
131+ if (processed.baseTransaction) {
132+ builder.baseTransaction = processed.baseTransaction
133+ }
134+ })
135+
136+ const submitSucceeded = () => {
137+ dispatch(form.created())
138+ dispatch(push({
139+ pathname: '/transactions',
140+ state: {
141+ preserveFlash: true
142+ }
143+ }))
144+ }
145+
144146 const normalTxSignAndSubmit = (transaction) => {
145147 const body = Object.assign({}, {password: formParams.password, transaction: transaction})
146148 return client.transactions.sign(body)
@@ -162,9 +164,8 @@ form.submitForm = (formParams) => function (dispatch) {
162164
163165 // normal transactions
164166 if(formParams.form === 'normalTx'){
165- const isPasswordChangeOnly = checkIfFormChanged()
166167
167- if(formParams.tpl !== '' && isPasswordChangeOnly){
168+ if(isPasswordChangeOnly){
168169 const transaction = JSON.parse(formParams.tpl.tx)
169170 return normalTxSignAndSubmit(transaction)
170171 } else{
Show on old repository browser