forked from extern/bruno
feat: skipping telemetry in dev env
This commit is contained in:
parent
037013005f
commit
fa40685a6a
@ -2,7 +2,8 @@ module.exports = {
|
||||
reactStrictMode: false,
|
||||
publicRuntimeConfig: {
|
||||
CI: process.env.CI,
|
||||
PLAYWRIGHT: process.env.PLAYWRIGHT
|
||||
PLAYWRIGHT: process.env.PLAYWRIGHT,
|
||||
ENV: process.env.ENV
|
||||
},
|
||||
webpack: (config, { isServer }) => {
|
||||
// Fixes npm packages that depend on `fs` module
|
||||
|
@ -3,7 +3,7 @@
|
||||
"version": "0.3.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"dev": "cross-env ENV=dev next dev",
|
||||
"build": "next build && next export",
|
||||
"start": "next start",
|
||||
"lint": "next lint",
|
||||
@ -61,6 +61,7 @@
|
||||
"@babel/preset-react": "^7.16.0",
|
||||
"@babel/runtime": "^7.16.3",
|
||||
"babel-loader": "^8.2.3",
|
||||
"cross-env": "^7.0.3",
|
||||
"css-loader": "^6.5.1",
|
||||
"file-loader": "^6.2.0",
|
||||
"html-loader": "^3.0.1",
|
||||
|
@ -23,7 +23,6 @@ const useCollectionTreeSync = () => {
|
||||
const { ipcRenderer } = window;
|
||||
|
||||
const _openCollection = (pathname, uid, name) => {
|
||||
console.log(`collection uid: ${uid}, pathname: ${pathname}, name: ${name}`);
|
||||
dispatch(openCollectionEvent(uid, pathname, name));
|
||||
};
|
||||
|
||||
|
@ -13,6 +13,10 @@ const isPlaywrightTestRunning = () => {
|
||||
return publicRuntimeConfig.PLAYWRIGHT ? true : false;
|
||||
};
|
||||
|
||||
const isDevEnv = () => {
|
||||
return publicRuntimeConfig.ENV === 'dev';
|
||||
};
|
||||
|
||||
// Todo support chrome and firefox extension
|
||||
const getPlatform = () => {
|
||||
return isElectron() ? 'electron' : 'web';
|
||||
@ -43,6 +47,10 @@ const trackStart = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
if(isDevEnv()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const trackingId = getAnonymousTrackingId();
|
||||
const platform = getPlatform();
|
||||
const client = getPosthogClient();
|
||||
|
Loading…
Reference in New Issue
Block a user