fix: Initialize home page after component creation
**Motivations :** - Fix blank page after account deletion - Ensure home page is properly initialized when navigating to home - Add proper initialization call after login-4nk-component creation **Modifications :** - Added initHomePage() call after login-4nk-component is added to DOM - Added error handling for home page initialization - Added debug logs to track initialization process **Pages affectées :** - src/router.ts - Added home page initialization in handleLocation
This commit is contained in:
parent
1d711932ce
commit
73b8d722c2
@ -55,6 +55,16 @@ async function handleLocation(path: string) {
|
|||||||
'width: 100vw; height: 100vh; position: relative; grid-row: 2;'
|
'width: 100vw; height: 100vh; position: relative; grid-row: 2;'
|
||||||
);
|
);
|
||||||
if (container) container.appendChild(accountComponent);
|
if (container) container.appendChild(accountComponent);
|
||||||
|
|
||||||
|
// Initialize the home page after component is added to DOM
|
||||||
|
console.log('🏠 Initializing home page...');
|
||||||
|
try {
|
||||||
|
const { initHomePage } = await import('./pages/home/home');
|
||||||
|
await initHomePage();
|
||||||
|
console.log('✅ Home page initialized successfully');
|
||||||
|
} catch (error) {
|
||||||
|
console.error('❌ Failed to initialize home page:', error);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
const html = await fetch(routeHtml).then(data => data.text());
|
const html = await fetch(routeHtml).then(data => data.text());
|
||||||
content.innerHTML = html;
|
content.innerHTML = html;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user