mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-08 13:00:13 +02:00
allow analytics opt out from env (#1454)
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
export const isAnalyticsDisabled = () => {
|
||||
return localStorage.getItem('umami.disabled') === '1' || process.env.NODE_ENV === 'development';
|
||||
const isSettingOptOut = localStorage.getItem('umami.disabled') === '1';
|
||||
const isDevMode = process.env.NODE_ENV === 'development';
|
||||
const isEnvOptOut =
|
||||
window && (window.ANALYTICS_DISABLED === true || window.ANALYTICS_DISABLED === 'true');
|
||||
|
||||
return isSettingOptOut || isDevMode || isEnvOptOut;
|
||||
};
|
||||
|
||||
Vendored
+5
@@ -1,5 +1,10 @@
|
||||
declare global {
|
||||
interface Window {
|
||||
ANALYTICS_DISABLED?: boolean | string;
|
||||
SERVER_LOCK?: boolean;
|
||||
SERVER_NAME?: string;
|
||||
SERVER_TYPE?: string;
|
||||
SERVER_URL?: string;
|
||||
umami?: {
|
||||
identify(unique_id: string): void;
|
||||
identify(unique_id: string, data: object): void;
|
||||
|
||||
Reference in New Issue
Block a user