File tree Expand file tree Collapse file tree
packages/neuron-ui/src/states/stateProvider/actionCreators Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,14 +15,29 @@ export const toggleAddressBook = () => {
1515}
1616
1717export const createNetwork = ( params : Controller . CreateNetworkParams ) => ( dispatch : StateDispatch , history : any ) => {
18- createRemoteNetwork ( params ) . then ( res => {
19- if ( res . status === 1 ) {
20- addPopup ( 'create-network-successfully' ) ( dispatch )
21- history . push ( Routes . SettingsNetworks )
22- } else {
23- addNotification ( failureResToNotification ( res ) ) ( dispatch )
24- }
18+ dispatch ( {
19+ type : AppActions . UpdateLoadings ,
20+ payload : {
21+ network : true ,
22+ } ,
2523 } )
24+ createRemoteNetwork ( params )
25+ . then ( res => {
26+ if ( res . status === 1 ) {
27+ addPopup ( 'create-network-successfully' ) ( dispatch )
28+ history . push ( Routes . SettingsNetworks )
29+ } else {
30+ addNotification ( failureResToNotification ( res ) ) ( dispatch )
31+ }
32+ } )
33+ . finally ( ( ) => {
34+ dispatch ( {
35+ type : AppActions . UpdateLoadings ,
36+ payload : {
37+ network : false ,
38+ } ,
39+ } )
40+ } )
2641}
2742
2843export const updateNetwork = ( params : Controller . UpdateNetworkParams ) => ( dispatch : StateDispatch , history : any ) => {
You can’t perform that action at this time.
0 commit comments