Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a701495607 | |||
| 88132b8f84 |
@@ -22,11 +22,18 @@ export default function AnalyticsShell() {
|
||||
return;
|
||||
}
|
||||
|
||||
const initServices = () => {
|
||||
import('@/lib/services/create-services').then(({ getAppServices }) => {
|
||||
getAppServices();
|
||||
setShouldLoad(true);
|
||||
}).catch(console.error);
|
||||
};
|
||||
|
||||
// Wait until browser is completely idle before loading heavy analytics/logger/sentry SDKs
|
||||
if (typeof window !== 'undefined' && 'requestIdleCallback' in window) {
|
||||
window.requestIdleCallback(() => setShouldLoad(true), { timeout: 3000 });
|
||||
window.requestIdleCallback(initServices, { timeout: 3000 });
|
||||
} else {
|
||||
const timer = setTimeout(() => setShouldLoad(true), 2500);
|
||||
const timer = setTimeout(initServices, 2500);
|
||||
return () => clearTimeout(timer);
|
||||
}
|
||||
}, []);
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
"prepare": "husky",
|
||||
"preinstall": "npx only-allow pnpm"
|
||||
},
|
||||
"version": "2.4.33",
|
||||
"version": "2.4.34",
|
||||
"pnpm": {
|
||||
"onlyBuiltDependencies": [
|
||||
"@parcel/watcher",
|
||||
|
||||
Reference in New Issue
Block a user