@@ -200,40 +200,18 @@ $(document).ready(function() {
200
200
201
201
$ ( '#cancel_grant' ) . on ( 'click' , function ( e ) {
202
202
$ ( '.modal-cancel-grants' ) . on ( 'click' , function ( e ) {
203
- let contract_address = $ ( '#contract_address' ) . val ( ) ;
204
- let grant_cancel_tx_id ;
205
- let deployedSubscription = new web3 . eth . Contract ( compiledSubscription . abi , contract_address ) ;
206
-
207
- web3 . eth . getAccounts ( function ( err , accounts ) {
208
- deployedSubscription . methods . endContract ( )
209
- . send ( {
210
- from : accounts [ 0 ] ,
211
- gas : 3000000
212
- } ) . on ( 'transactionHash' , function ( transactionHash ) {
213
- grant_cancel_tx_id = $ ( '#grant_cancel_tx_id' ) . val ( ) ;
214
- const linkURL = get_etherscan_url ( transactionHash ) ;
215
-
216
- document . issueURL = linkURL ;
217
- $ ( '#transaction_url' ) . attr ( 'href' , linkURL ) ;
218
- $ ( '.modal .close' ) . trigger ( 'click' ) ;
219
- enableWaitState ( '#grants-details' ) ;
220
- } )
221
- . on ( 'confirmation' , function ( confirmationNumber , receipt ) {
222
- $ . ajax ( {
223
- type : 'post' ,
224
- url : '' ,
225
- data : {
226
- 'contract_address' : contract_address ,
227
- 'grant_cancel_tx_id' : grant_cancel_tx_id
228
- } ,
229
- success : function ( json ) {
230
- window . location . reload ( false ) ;
231
- } ,
232
- error : function ( ) {
233
- _alert ( { message : gettext ( 'Canceling your grant failed to save. Please try again.' ) } , 'error' ) ;
234
- }
235
- } ) ;
236
- } ) ;
203
+ $ . ajax ( {
204
+ type : 'post' ,
205
+ url : '' ,
206
+ data : {
207
+ 'grant_cancel_tx_id' : '0x0' ,
208
+ } ,
209
+ success : function ( json ) {
210
+ window . location . reload ( false ) ;
211
+ } ,
212
+ error : function ( ) {
213
+ _alert ( { message : gettext ( 'Canceling your grant failed to save. Please try again.' ) } , 'error' ) ;
214
+ }
237
215
} ) ;
238
216
} ) ;
239
217
} ) ;
0 commit comments