1- import { NeuronWalletActions , AppActions , StateDispatch } from 'states/stateProvider/reducer'
1+ import { NeuronWalletActions , StateDispatch } from 'states/stateProvider/reducer'
22import {
33 GetTransactionListParams ,
44 getTransactionList ,
@@ -23,12 +23,6 @@ export const updateTransactionList = (params: GetTransactionListParams) => (disp
2323export const updateTransactionDescription = ( params : Controller . UpdateTransactionDescriptionParams ) => (
2424 dispatch : StateDispatch
2525) => {
26- dispatch ( {
27- type : AppActions . UpdateLoadings ,
28- payload : {
29- updateDescription : true ,
30- } ,
31- } )
3226 const descriptionParams = {
3327 hash : params . hash ,
3428 description : params . description ,
@@ -37,25 +31,16 @@ export const updateTransactionDescription = (params: Controller.UpdateTransactio
3731 type : NeuronWalletActions . UpdateTransactionDescription ,
3832 payload : descriptionParams ,
3933 } ) // update local description before remote description to avoid the flicker on the field
40- updateRemoteTransactionDescription ( params )
41- . then ( res => {
42- if ( res . status ) {
43- dispatch ( {
44- type : NeuronWalletActions . UpdateTransactionDescription ,
45- payload : descriptionParams ,
46- } )
47- } else {
48- addNotification ( failureResToNotification ( res ) ) ( dispatch )
49- }
50- } )
51- . finally ( ( ) => {
34+ updateRemoteTransactionDescription ( params ) . then ( res => {
35+ if ( res . status ) {
5236 dispatch ( {
53- type : AppActions . UpdateLoadings ,
54- payload : {
55- updateDescription : false ,
56- } ,
37+ type : NeuronWalletActions . UpdateTransactionDescription ,
38+ payload : descriptionParams ,
5739 } )
58- } )
40+ } else {
41+ addNotification ( failureResToNotification ( res ) ) ( dispatch )
42+ }
43+ } )
5944}
6045
6146export default {
0 commit comments