Skip to content

Commit

Permalink
fix: wait for node status to be fetched before continueing
Browse files Browse the repository at this point in the history
  • Loading branch information
binarybaron committed Nov 14, 2024
1 parent 30e7dea commit 7758366
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src-gui/src/renderer/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ export async function initializeContext() {
Object.values(store.getState().nodes.nodes[blockchain]).length < store.getState().settings.nodes[network][blockchain].length
)) {
try {
console.log("Updating node statuses");
await updateAllNodeStatuses();
} catch (e) {
logger.error(e, "Failed to update node statuses");
Expand Down Expand Up @@ -296,9 +297,7 @@ export async function updateAllNodeStatuses() {
// For all nodes, check if they are available and store the new status (in parallel)
await Promise.all(
Object.values(Blockchain).flatMap(blockchain =>
settings.nodes[network][blockchain].map(async node => {
updateNodeStatus(node, blockchain);
})
settings.nodes[network][blockchain].map(node => updateNodeStatus(node, blockchain))
)
);
}
Expand Down

0 comments on commit 7758366

Please sign in to comment.