feat: add auto-redirect to pairing after block sync and update button text

**Motivations :**
- Passer automatiquement au pairing après 3 secondes une fois la synchronisation terminée
- Améliorer le texte du bouton pour indiquer qu'on va au pairing

**Modifications :**
- Ajouter redirection automatique après 3 secondes quand synchronisation terminée (blocs déjà synchronisés ou scan complété)
- Changer le texte du bouton de "Terminer la synchronisation" à "Aller au pairing"
- Mettre à jour le statut pour indiquer la redirection automatique

**Pages affectées :**
- src/pages/block-sync/block-sync.html (texte du bouton)
- src/pages/block-sync/block-sync.ts (redirection automatique après 3 secondes)
This commit is contained in:
NicolasCantu 2025-10-29 17:09:10 +01:00
parent 0d3163b5b2
commit af78165aee
2 changed files with 15 additions and 1 deletions

View File

@ -180,7 +180,7 @@
</div> </div>
<button id="continueBtn" class="continue-btn" disabled> <button id="continueBtn" class="continue-btn" disabled>
Terminer la synchronisation Aller au pairing
</button> </button>
</div> </div>

View File

@ -180,7 +180,14 @@ document.addEventListener("DOMContentLoaded", async () => {
updateProgress(100); updateProgress(100);
updateSyncItem('blocksScanned', lastScan.toString(), 'completed'); updateSyncItem('blocksScanned', lastScan.toString(), 'completed');
updateSyncItem('blocksToScan', '0', 'completed'); updateSyncItem('blocksToScan', '0', 'completed');
// Redirection automatique après 3 secondes
updateStatus('✅ Redirection automatique vers le pairing dans 3 secondes...', 'success');
continueBtn.disabled = false; continueBtn.disabled = false;
setTimeout(() => {
console.log('🔗 Auto-redirecting to pairing page...');
window.location.href = '/src/pages/home/home.html';
}, 3000);
return; return;
} }
@ -214,6 +221,13 @@ document.addEventListener("DOMContentLoaded", async () => {
} }
console.log('🎉 Block sync completed successfully'); console.log('🎉 Block sync completed successfully');
// Redirection automatique après 3 secondes
updateStatus('✅ Redirection automatique vers le pairing dans 3 secondes...', 'success');
setTimeout(() => {
console.log('🔗 Auto-redirecting to pairing page...');
window.location.href = '/src/pages/home/home.html';
}, 3000);
} else { } else {
throw new Error('Failed to verify wallet update - last_scan not found'); throw new Error('Failed to verify wallet update - last_scan not found');
} }