Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion custom-app/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
document.getElementById('builtwithfern')?.remove()
}

window.addEventListener('load', async () => {
const initializeApp = async () => {
console.log('initializeApp')

Check warning on line 38 in custom-app/src/main.tsx

View workflow job for this annotation

GitHub Actions / Lint Files

Unexpected console statement. Only these console methods are allowed: warn, error, info
// Only render on /docs or /docs/
const initialPath = window.location.pathname.replace(/\/+$/, '')

Expand Down Expand Up @@ -67,4 +68,14 @@
})

observer.observe(document.body, { childList: true, subtree: true })
}

// Run immediately when script loads (for direct navigation to homepage)
console.log('running initializeApp')

Check warning on line 74 in custom-app/src/main.tsx

View workflow job for this annotation

GitHub Actions / Lint Files

Unexpected console statement. Only these console methods are allowed: warn, error, info
initializeApp()

// Also run on popstate (for back/forward navigation)
window.addEventListener('popstate', () => {
console.log('popstate')

Check warning on line 79 in custom-app/src/main.tsx

View workflow job for this annotation

GitHub Actions / Lint Files

Unexpected console statement. Only these console methods are allowed: warn, error, info
initializeApp()
})
Loading