Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Sadegh Hayeri committed Mar 12, 2020
1 parent 003b4bf commit db02645
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
3 changes: 0 additions & 3 deletions bin/gt.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ const yargs = require('yargs');
const pkg = require('../package.json');
const {Proxy, config, getLogger} = require('../src/index.cjs');

const {appInit} = require('../src/utils/analytics');
appInit();

const logger = getLogger('cli');

const {argv} = yargs
Expand Down
4 changes: 2 additions & 2 deletions src/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import DNSOverTLS from './dns/tls';
import DNSOverHTTPS from './dns/https';
import config from './config';
import getLogger from './logger';
import {appUse} from './utils/analytics';
import {appInit} from './utils/analytics';

const logger = getLogger('proxy');

Expand All @@ -24,7 +24,7 @@ export default class Proxy {
}

async start(options = {}) {
appUse();
appInit();
options.setProxy = options.setProxy === undefined ? false : options.setProxy;

this.server = net.createServer({pauseOnConnect: true}, clientSocket => {
Expand Down
8 changes: 2 additions & 6 deletions src/utils/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ nodeStorage.setItem('userid', userId);
var visitor = ua('UA-160385585-1', userId);

function appInit() {
visitor.event("gt-cli", "init").send()
visitor.event("gt", "init").send()
}

function appUse() {
visitor.event("gt-library", "init").send()
}

export {appInit, appUse};
export {appInit};

0 comments on commit db02645

Please sign in to comment.