diff --git a/src/pages/home/home-component.ts b/src/pages/home/home-component.ts
index b38e1a5..d7af469 100644
--- a/src/pages/home/home-component.ts
+++ b/src/pages/home/home-component.ts
@@ -1,5 +1,6 @@
+// src/pages/home/home-component.ts
+
import loginHtml from './home.html?raw';
-import loginScript from './home.ts?raw';
import loginCss from '../../4nk.css?raw';
import { initHomePage } from './home';
@@ -11,11 +12,26 @@ export class LoginComponent extends HTMLElement {
}
connectedCallback() {
- console.log('CALLBACK LOGIN PAGE');
this.render();
- setTimeout(() => {
- initHomePage();
- }, 500);
+
+ try {
+ if (this.shadowRoot) {
+ initHomePage(this.shadowRoot);
+ } else {
+ console.error("[LoginComponent] đ„ ShadowRoot est nul. Impossible d'initialiser.");
+ }
+ } catch (e) {
+ console.error("[LoginComponent] đ„ Ăchec de l'initHomePage:", e);
+ }
+ }
+
+ render() {
+ if (this.shadowRoot) {
+ this.shadowRoot.innerHTML = `
+
+ ${loginHtml}
+ `;
+ }
}
set callback(fn) {
@@ -25,23 +41,9 @@ export class LoginComponent extends HTMLElement {
console.error('Callback is not a function');
}
}
-
get callback() {
return this._callback;
}
-
- render() {
- if (this.shadowRoot)
- this.shadowRoot.innerHTML = `
- ${loginHtml}
-