From 72e7f9b92001ec1afb46e86861a12a0465cca152 Mon Sep 17 00:00:00 2001 From: NicolasCantu Date: Wed, 29 Oct 2025 20:58:59 +0100 Subject: [PATCH] Replace initializing service modal with status message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Motivations :** - La modale 'Initializing services...' n'est plus nécessaire - Les messages de statut dans le champ des messages sont plus appropriés - Simplification de l'interface utilisateur **Modifications :** - service.ts : Suppression des fonctions showGlobalLoadingSpinner et hideGlobalLoadingSpinner - service.ts : Remplacement de la modale par updateUserStatus('🔄 Initializing services...') - service.ts : Ajout d'un message de succès après initialisation **Pages affectées :** - src/services/service.ts : Suppression de la modale et utilisation des messages de statut --- src/services/service.ts | 104 ++-------------------------------------- 1 file changed, 5 insertions(+), 99 deletions(-) diff --git a/src/services/service.ts b/src/services/service.ts index 486b221..4b0f637 100755 --- a/src/services/service.ts +++ b/src/services/service.ts @@ -29,101 +29,7 @@ const STORAGEURL = import.meta.env.VITE_STORAGEURL || `${BASEURL}:8081`; const BLINDBITURL = import.meta.env.VITE_BLINDBITURL || `${BASEURL}:8000`; const DEFAULTAMOUNT = 1000n; -// Global loading spinner functions -function showGlobalLoadingSpinner(message: string = 'Loading...') { - // Remove existing spinner if any - hideGlobalLoadingSpinner(); - - // Create spinner overlay - const overlay = document.createElement('div'); - overlay.id = 'global-loading-overlay'; - overlay.style.cssText = ` - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: rgba(0, 0, 0, 0.8); - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - z-index: 9999; - backdrop-filter: blur(5px); - `; - - // Create spinner content - const spinnerContent = document.createElement('div'); - spinnerContent.style.cssText = ` - background: rgba(255, 255, 255, 0.95); - border-radius: 12px; - padding: 40px; - text-align: center; - box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); - border: 1px solid rgba(255, 255, 255, 0.2); - max-width: 400px; - width: 90%; - `; - - // Create spinner - const spinner = document.createElement('div'); - spinner.style.cssText = ` - width: 50px; - height: 50px; - border: 4px solid #f3f3f3; - border-top: 4px solid #3a506b; - border-radius: 50%; - animation: spin 1s linear infinite; - margin: 0 auto 20px auto; - `; - - // Create message - const messageEl = document.createElement('div'); - messageEl.textContent = message; - messageEl.style.cssText = ` - font-size: 16px; - color: #3a506b; - font-weight: 500; - margin-bottom: 10px; - `; - - // Create progress indicator - const progressEl = document.createElement('div'); - progressEl.textContent = 'Please wait...'; - progressEl.style.cssText = ` - font-size: 14px; - color: #666; - `; - - // Add CSS animation if not already present - if (!document.getElementById('global-spinner-styles')) { - const style = document.createElement('style'); - style.id = 'global-spinner-styles'; - style.textContent = ` - @keyframes spin { - 0% { transform: rotate(0deg); } - 100% { transform: rotate(360deg); } - } - `; - document.head.appendChild(style); - } - - // Assemble spinner - spinnerContent.appendChild(spinner); - spinnerContent.appendChild(messageEl); - spinnerContent.appendChild(progressEl); - overlay.appendChild(spinnerContent); - - // Add to document - document.body.appendChild(overlay); -} - -function hideGlobalLoadingSpinner() { - const overlay = document.getElementById('global-loading-overlay'); - if (overlay) { - overlay.remove(); - } -} +// Global loading spinner functions removed - now using updateUserStatus instead const EMPTY32BYTES = String('').padStart(64, '0'); export default class Services { @@ -207,8 +113,8 @@ export default class Services { } } - // Show global loading spinner during initialization - showGlobalLoadingSpinner('Initializing services...'); + // Update user status during initialization + this.updateUserStatus('🔄 Initializing services...'); // Add WebAssembly memory optimization and error handling try { @@ -342,8 +248,8 @@ export default class Services { throw error; } - // Hide loading spinner after initialization - hideGlobalLoadingSpinner(); + // Update user status after successful initialization + this.updateUserStatus('✅ Services initialized successfully'); return Services.instance; }