Skip to content

Commit

Permalink
fix: should remove app skeleton in error page
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <tukon479@gmail.com>
  • Loading branch information
Innei committed Nov 6, 2024
1 parent 1739208 commit 4073632
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/renderer/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ const AppLayer = () => {
const appIsReady = useAppIsReady()

useEffect(() => {
document.querySelector("#app-skeleton")?.remove()

const doneTime = Math.trunc(performance.now())
window.analytics?.capture("ui_render_init", {
time: doneTime,
})
appLog("App is ready", `${doneTime}ms`)

applyAfterReadyCallbacks()

document.querySelector("#app-skeleton")?.remove()
}, [appIsReady])

return appIsReady ? <Outlet /> : <AppSkeleton />
Expand Down
4 changes: 4 additions & 0 deletions apps/renderer/src/components/common/ErrorElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export function ErrorElement() {
: JSON.stringify(error)
const stack = error instanceof Error ? error.stack : null

useEffect(() => {
document.querySelector("#app-skeleton")?.remove()
}, [])

useEffect(() => {
console.error("Error handled by React Router default ErrorBoundary:", error)

Expand Down

0 comments on commit 4073632

Please sign in to comment.