diff --git a/src/pages/birthday-setup/birthday-setup.ts b/src/pages/birthday-setup/birthday-setup.ts index e36af60..9182ddd 100644 --- a/src/pages/birthday-setup/birthday-setup.ts +++ b/src/pages/birthday-setup/birthday-setup.ts @@ -67,17 +67,17 @@ document.addEventListener('DOMContentLoaded', async () => { // Attendre que la hauteur de bloc soit définie avant de mettre à jour la date anniversaire updateStatus('⏳ Attente de la synchronisation avec le réseau...', 'loading'); - let attempts = 0; - const maxAttempts = 30; - while (attempts < maxAttempts) { + let blockHeightAttempts = 0; + const blockHeightMaxAttempts = 30; + while (blockHeightAttempts < blockHeightMaxAttempts) { const blockHeight = services.getCurrentBlockHeight(); if (blockHeight !== -1) { console.log(`✅ Block height set: ${blockHeight}`); break; } - console.log(`⏳ Waiting for block height (attempt ${attempts + 1}/${maxAttempts})...`); + console.log(`⏳ Waiting for block height (attempt ${blockHeightAttempts + 1}/${blockHeightMaxAttempts})...`); await new Promise(resolve => setTimeout(resolve, 100)); - attempts++; + blockHeightAttempts++; } if (services.getCurrentBlockHeight() === -1) {