From 9f440ecf32a2e3ccf71be227c1cad77244a9c152 Mon Sep 17 00:00:00 2001 From: koalasat Date: Mon, 11 Nov 2024 12:19:41 +0100 Subject: [PATCH] Fix loading coordinators calc --- frontend/src/models/Federation.model.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/models/Federation.model.ts b/frontend/src/models/Federation.model.ts index 165cfea2..b53826b7 100644 --- a/frontend/src/models/Federation.model.ts +++ b/frontend/src/models/Federation.model.ts @@ -183,6 +183,7 @@ export class Federation { for (const coor of Object.values(this.coordinators)) { coor.loadInfo(() => { + this.exchange.onlineCoordinators = this.exchange.onlineCoordinators + 1; this.onCoordinatorSaved(); }); } @@ -205,14 +206,15 @@ export class Federation { loadBook = async (): Promise => { if (this.connection !== 'api') return; - this.loading = true; this.book = {}; - this.triggerHook('onFederationUpdate'); + this.loading = true; + this.exchange.onlineCoordinators = 0; this.exchange.loadingCoordinators = Object.keys(this.coordinators).length; + this.triggerHook('onFederationUpdate'); for (const coor of Object.values(this.coordinators)) { coor.loadBook(() => { + this.exchange.onlineCoordinators = this.exchange.onlineCoordinators + 1; this.onCoordinatorSaved(); - this.triggerHook('onFederationUpdate'); }); } };