Compare commits
2 Commits
50903c7e39
...
12b8c100c9
| Author | SHA1 | Date | |
|---|---|---|---|
| 12b8c100c9 | |||
| 7c6f5c8739 |
12
src/main.ts
12
src/main.ts
@ -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.');
|
||||
|
||||
@ -71,7 +71,6 @@ async function emojisPairingRequest() {
|
||||
|
||||
// Display address emojis and other device emojis
|
||||
export async function displayEmojis(text: string) {
|
||||
console.log("🚀 ~ Services ~ adressToEmoji");
|
||||
try {
|
||||
const container = getCorrectDOM("login-4nk-component") as HTMLElement;
|
||||
const emojis = await addressToEmoji(text);
|
||||
|
||||
@ -306,7 +306,6 @@ export class CoreBackend {
|
||||
}
|
||||
|
||||
public async ensureConnections(process: Process, stateId: string | null = null): Promise<void> {
|
||||
console.info(`[CoreWorker] 🔄 Check connexions (StateID: ${stateId || 'default'})`);
|
||||
if (!process) return;
|
||||
|
||||
let state: ProcessState | null = null;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user