refactor(main): remove obsolete database initialization and streamline comments for improved clarity in bootstrap function

This commit is contained in:
NicolasCantu 2025-12-02 00:37:16 +01:00
parent 7c6f5c8739
commit 12b8c100c9

View File

@ -12,9 +12,6 @@ async function bootstrap() {
// Cela va lancer les workers en arrière-plan
const services = await Services.getInstance();
// ❌ SUPPRIMÉ : await Database.getInstance();
// La BDD est maintenant gérée de manière autonome par le CoreWorker.
// Injection du Header
const headerSlot = document.getElementById('header-slot');
if (headerSlot) {
@ -34,22 +31,19 @@ async function bootstrap() {
// 3. Initialisation du contrôleur d'Iframe (Reste sur le Main Thread pour écouter window)
await IframeController.init();
// 4. Restauration des données (Appels asynchrones au Worker)
// 4. Restauration des données
await services.restoreProcessesFromDB();
// ⚠️ Assurez-vous d'avoir ajouté 'restoreSecretsFromDB' dans votre CoreWorker & Services
if (services.restoreSecretsFromDB) {
await services.restoreSecretsFromDB();
} else {
console.warn("restoreSecretsFromDB non implémenté dans le proxy Services");
}
// 5. Connexion réseau (Network Worker)
await services.connectAllRelays();
// 6. Gestion du Routing
// 5. Gestion du Routing
const isIframe = window.self !== window.top;
const isPaired = await services.isPaired(); // Appel async maintenant
const isPaired = await services.isPaired();
if (isPaired && !isIframe) {
console.log('✅ Mode Standalone & Appairé : Redirection vers Process.');