@@ -51,8 +51,10 @@ export class Federation {
51
51
} ) ;
52
52
} ;
53
53
54
- onCoordinatorSaved = ( shortAlias : string ) : void => {
55
- this . book = [ ...this . book , ...this . getCoordinator ( shortAlias ) . book ] ;
54
+ onCoordinatorSaved = ( ) : void => {
55
+ this . book = Object . values ( this . coordinators ) . reduce < PublicOrder [ ] > ( ( array , coordinator ) => {
56
+ return [ ...array , ...coordinator . book ] ;
57
+ } , [ ] ) ;
56
58
this . loading = false ;
57
59
this . triggerHook ( 'onCoordinatorUpdate' ) ;
58
60
if ( Object . values ( this . coordinators ) . every ( ( coor ) => coor . isUpdated ( ) ) ) {
@@ -63,9 +65,9 @@ export class Federation {
63
65
64
66
// Setup
65
67
start = async ( origin : Origin , settings : Settings , hostUrl : string ) : Promise < void > => {
66
- const onCoordinatorStarted = ( shortAlias : string ) : void => {
68
+ const onCoordinatorStarted = ( ) : void => {
67
69
this . exchange . onlineCoordinators = this . exchange . onlineCoordinators + 1 ;
68
- this . onCoordinatorSaved ( shortAlias ) ;
70
+ this . onCoordinatorSaved ( ) ;
69
71
} ;
70
72
this . loading = true ;
71
73
for ( const coor of Object . values ( this . coordinators ) ) {
@@ -77,7 +79,7 @@ export class Federation {
77
79
this . loading = false ;
78
80
for ( const coor of Object . values ( this . coordinators ) ) {
79
81
await coor . update ( ( ) => {
80
- this . onCoordinatorSaved ( coor . shortAlias ) ;
82
+ this . onCoordinatorSaved ( ) ;
81
83
} ) ;
82
84
}
83
85
} ;
@@ -86,7 +88,7 @@ export class Federation {
86
88
this . loading = false ;
87
89
for ( const coor of Object . values ( this . coordinators ) ) {
88
90
await coor . updateBook ( ( ) => {
89
- this . onCoordinatorSaved ( coor . shortAlias ) ;
91
+ this . onCoordinatorSaved ( ) ;
90
92
} ) ;
91
93
}
92
94
} ;
0 commit comments