Compare commits
No commits in common. "12b8c100c9cddccca56034dff4b901c267e44c73" and "50903c7e39eabc433b00a08dd84147c5750f1f82" have entirely different histories.
12b8c100c9
...
50903c7e39
12
src/main.ts
12
src/main.ts
@ -12,6 +12,9 @@ async function bootstrap() {
|
|||||||
// Cela va lancer les workers en arrière-plan
|
// Cela va lancer les workers en arrière-plan
|
||||||
const services = await Services.getInstance();
|
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
|
// Injection du Header
|
||||||
const headerSlot = document.getElementById('header-slot');
|
const headerSlot = document.getElementById('header-slot');
|
||||||
if (headerSlot) {
|
if (headerSlot) {
|
||||||
@ -31,19 +34,22 @@ async function bootstrap() {
|
|||||||
// 3. Initialisation du contrôleur d'Iframe (Reste sur le Main Thread pour écouter window)
|
// 3. Initialisation du contrôleur d'Iframe (Reste sur le Main Thread pour écouter window)
|
||||||
await IframeController.init();
|
await IframeController.init();
|
||||||
|
|
||||||
// 4. Restauration des données
|
// 4. Restauration des données (Appels asynchrones au Worker)
|
||||||
await services.restoreProcessesFromDB();
|
await services.restoreProcessesFromDB();
|
||||||
|
|
||||||
|
// ⚠️ Assurez-vous d'avoir ajouté 'restoreSecretsFromDB' dans votre CoreWorker & Services
|
||||||
if (services.restoreSecretsFromDB) {
|
if (services.restoreSecretsFromDB) {
|
||||||
await services.restoreSecretsFromDB();
|
await services.restoreSecretsFromDB();
|
||||||
} else {
|
} else {
|
||||||
console.warn("restoreSecretsFromDB non implémenté dans le proxy Services");
|
console.warn("restoreSecretsFromDB non implémenté dans le proxy Services");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 5. Connexion réseau (Network Worker)
|
||||||
|
await services.connectAllRelays();
|
||||||
|
|
||||||
// 5. Gestion du Routing
|
// 6. Gestion du Routing
|
||||||
const isIframe = window.self !== window.top;
|
const isIframe = window.self !== window.top;
|
||||||
const isPaired = await services.isPaired();
|
const isPaired = await services.isPaired(); // Appel async maintenant
|
||||||
|
|
||||||
if (isPaired && !isIframe) {
|
if (isPaired && !isIframe) {
|
||||||
console.log('✅ Mode Standalone & Appairé : Redirection vers Process.');
|
console.log('✅ Mode Standalone & Appairé : Redirection vers Process.');
|
||||||
|
|||||||
@ -71,6 +71,7 @@ async function emojisPairingRequest() {
|
|||||||
|
|
||||||
// Display address emojis and other device emojis
|
// Display address emojis and other device emojis
|
||||||
export async function displayEmojis(text: string) {
|
export async function displayEmojis(text: string) {
|
||||||
|
console.log("🚀 ~ Services ~ adressToEmoji");
|
||||||
try {
|
try {
|
||||||
const container = getCorrectDOM("login-4nk-component") as HTMLElement;
|
const container = getCorrectDOM("login-4nk-component") as HTMLElement;
|
||||||
const emojis = await addressToEmoji(text);
|
const emojis = await addressToEmoji(text);
|
||||||
|
|||||||
@ -306,6 +306,7 @@ export class CoreBackend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async ensureConnections(process: Process, stateId: string | null = null): Promise<void> {
|
public async ensureConnections(process: Process, stateId: string | null = null): Promise<void> {
|
||||||
|
console.info(`[CoreWorker] 🔄 Check connexions (StateID: ${stateId || 'default'})`);
|
||||||
if (!process) return;
|
if (!process) return;
|
||||||
|
|
||||||
let state: ProcessState | null = null;
|
let state: ProcessState | null = null;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user