mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
add analytics to 5chan.app
This commit is contained in:
@@ -7,12 +7,19 @@ import './lib/init-translations';
|
||||
import './index.css';
|
||||
import './themes.css';
|
||||
import { App as CapacitorApp } from '@capacitor/app';
|
||||
import { Analytics } from '@vercel/analytics/react';
|
||||
|
||||
// Only enable analytics on 5chan.app (Vercel deployment)
|
||||
// Exclude Electron (file:// or localhost), Capacitor/APK (capacitor:// or localhost), and IPFS (ipfs:// or different domain)
|
||||
const isVercelDeployment =
|
||||
typeof window !== 'undefined' && (window.location.hostname === '5chan.app' || window.location.hostname === 'www.5chan.app') && !window.isElectron;
|
||||
|
||||
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<Router>
|
||||
<App />
|
||||
{isVercelDeployment && <Analytics />}
|
||||
</Router>
|
||||
</React.StrictMode>,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user