diff --git a/src/pages/birthday-setup/birthday-setup.ts b/src/pages/birthday-setup/birthday-setup.ts index 8a1e57f..c551f07 100644 --- a/src/pages/birthday-setup/birthday-setup.ts +++ b/src/pages/birthday-setup/birthday-setup.ts @@ -5,8 +5,18 @@ import { checkPBKDF2Key, checkWalletWithRetries } from '../../utils/prerequisites.utils'; +let isInitializing = false; + document.addEventListener('DOMContentLoaded', async () => { + if (isInitializing) { + console.log('⚠️ Birthday setup page already initializing, skipping...'); + return; + } + + isInitializing = true; console.log('🎂 Birthday setup page loaded'); + console.log('🔍 Current URL:', window.location.href); + console.log('🔍 Referrer:', document.referrer); const status = document.getElementById('status') as HTMLDivElement; const progressBar = document.getElementById('progressBar') as HTMLDivElement; @@ -167,6 +177,8 @@ document.addEventListener('DOMContentLoaded', async () => { } catch (error) { console.error('❌ Error during birthday setup:', error); updateStatus('❌ Erreur lors de la configuration de la date anniversaire', 'error'); + } finally { + isInitializing = false; } // Gestion du bouton continuer diff --git a/src/services/service.ts b/src/services/service.ts index 2fea83e..486b221 100755 --- a/src/services/service.ts +++ b/src/services/service.ts @@ -2315,7 +2315,7 @@ export default class Services { // Check if wallet is already synchronized const lastScan = device.sp_wallet.last_scan || 0; const isSynchronized = lastScan >= this.currentBlockHeight; - + if (isSynchronized) { console.log(`✅ Wallet already synchronized (last_scan: ${lastScan}, current: ${this.currentBlockHeight})`); return;