[bug] Update device blockheight right after initialization to prevent race condition
All checks were successful
Build and Push to Registry / build-and-push (push) Successful in 2m25s

This commit is contained in:
Sosthene 2025-09-13 08:12:30 +02:00
parent 457994c506
commit 0d473cf3d1
2 changed files with 1 additions and 2 deletions

View File

@ -156,8 +156,6 @@ export async function init(): Promise<void> {
// We connect to all relays now
await services.connectAllRelays();
await services.updateDeviceBlockHeight();
// We register all the event listeners if we run in an iframe
if (window.self !== window.top) {
await registerAllListeners();

View File

@ -1369,6 +1369,7 @@ export default class Services {
console.log('handshakeMsg:', handshakeMsg);
this.currentBlockHeight = handshakeMsg.chain_tip;
console.log('this.currentBlockHeight:', this.currentBlockHeight);
this.updateDeviceBlockHeight();
if (this.membersList && Object.keys(this.membersList).length === 0) {
// We start from an empty list, just copy it over
this.membersList = handshakeMsg.peers_list;