@@ -146,7 +146,7 @@ export class DealsRegistry<
146
146
. then ( ( ) => {
147
147
this . checkInterval = setInterval ( ( ) => {
148
148
this . _checkDealsStates ( ) . catch ( logger . error ) ;
149
- } , 2000 ) ;
149
+ } , 5000 ) ;
150
150
} )
151
151
. catch ( logger . error ) ;
152
152
}
@@ -360,7 +360,11 @@ export class DealsRegistry<
360
360
txCallback ,
361
361
) ;
362
362
363
- return await this . _buildDealRecord ( offer ) ;
363
+ const record = await this . _buildDealRecord ( offer ) ;
364
+
365
+ this . dispatchEvent ( new CustomEvent < void > ( 'changed' ) ) ;
366
+
367
+ return record ;
364
368
}
365
369
366
370
/**
@@ -436,7 +440,16 @@ export class DealsRegistry<
436
440
txCallback ,
437
441
) ;
438
442
439
- return await this . _buildDealRecord ( dealRecord . offer ) ;
443
+ const record = await this . _buildDealRecord ( dealRecord . offer ) ;
444
+
445
+ this . dispatchEvent (
446
+ new CustomEvent < DealRecord < CustomRequestQuery , CustomOfferOptions > > ( 'status' , {
447
+ detail : record ,
448
+ } ) ,
449
+ ) ;
450
+ this . dispatchEvent ( new CustomEvent < void > ( 'changed' ) ) ;
451
+
452
+ return record ;
440
453
}
441
454
442
455
/**
@@ -495,7 +508,16 @@ export class DealsRegistry<
495
508
txCallback ,
496
509
) ;
497
510
498
- return await this . _buildDealRecord ( dealRecord . offer ) ;
511
+ const record = await this . _buildDealRecord ( dealRecord . offer ) ;
512
+
513
+ this . dispatchEvent (
514
+ new CustomEvent < DealRecord < CustomRequestQuery , CustomOfferOptions > > ( 'status' , {
515
+ detail : record ,
516
+ } ) ,
517
+ ) ;
518
+ this . dispatchEvent ( new CustomEvent < void > ( 'changed' ) ) ;
519
+
520
+ return record ;
499
521
}
500
522
501
523
/**
@@ -547,6 +569,15 @@ export class DealsRegistry<
547
569
txCallback ,
548
570
) ;
549
571
550
- return await this . _buildDealRecord ( dealRecord . offer ) ;
572
+ const record = await this . _buildDealRecord ( dealRecord . offer ) ;
573
+
574
+ this . dispatchEvent (
575
+ new CustomEvent < DealRecord < CustomRequestQuery , CustomOfferOptions > > ( 'status' , {
576
+ detail : record ,
577
+ } ) ,
578
+ ) ;
579
+ this . dispatchEvent ( new CustomEvent < void > ( 'changed' ) ) ;
580
+
581
+ return record ;
551
582
}
552
583
}
0 commit comments