Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

chore: remove nested RAF

Faisal Amir6aae11c7ca43
diff --git a/web-app/src/routes/__root.tsx b/web-app/src/routes/__root.tsx
index a11a67453..0f6cecf3c 100644
--- a/web-app/src/routes/__root.tsx
+++ b/web-app/src/routes/__root.tsx
@@ -211,23 +211,21 @@ function RootLayout() {
// Wait for the UI to be fully rendered before hiding the loader
const hideLoader = () => {
requestAnimationFrame(() => {
- requestAnimationFrame(() => {
- // Hide the HTML loader
- document.body.classList.add('loaded')
+ // Hide the HTML loader
+ document.body.classList.add('loaded')
- // Remove the HTML loader element after transition
- const loader = document.getElementById('initial-loader')
- if (loader) {
- setTimeout(() => {
- loader.remove()
- }, 300)
- }
- })
+ // Remove the HTML loader element after transition
+ const loader = document.getElementById('initial-loader')
+ if (loader) {
+ setTimeout(() => {
+ loader.remove()
+ }, 300)
+ }
})
}
- // Give providers time to initialize
- const timer = setTimeout(hideLoader, 100)
+ // Give providers time to initialize and paint
+ const timer = setTimeout(hideLoader, 200)
return () => clearTimeout(timer)
}, [])