File tree Expand file tree Collapse file tree 2 files changed +13
-17
lines changed Expand file tree Collapse file tree 2 files changed +13
-17
lines changed Original file line number Diff line number Diff line change 11import ShortUniqueId from 'short-unique-id' ;
2- import BuildApi from './BuildApi' ;
32import { set as setConfig , get as getConfig } from './ConfigStorage' ;
43import GUI from './gui' ;
54import CONFIGURATOR from './data_storage' ;
@@ -74,7 +73,7 @@ class Analytics {
7473 this . setOptOut ( settings . optOut ) ;
7574
7675 this . _settings = settings ;
77- this . _api = new BuildApi ( ) ;
76+ this . _url = 'https://analytics.betaflight.com' ;
7877
7978 this . EVENT_CATEGORIES = {
8079 APPLICATION : 'Application' ,
@@ -90,11 +89,19 @@ class Analytics {
9089 return ;
9190 }
9291
93- this . _api . sendAnalytics ( name , {
94- sessionId : this . _settings . sessionId ,
95- userId : this . _settings . userId ,
96- [ name ] : properties ,
92+ const url = `${ this . _url } /analytics/${ name } ` ;
93+ $ . ajax ( {
94+ url : url ,
95+ type : "POST" ,
96+ data : JSON . stringify ( {
97+ sessionId : this . _settings . sessionId ,
98+ userId : this . _settings . userId ,
99+ [ name ] : properties ,
100+ } ) ,
101+ contentType : "application/json" ,
102+ dataType : "json" ,
97103 } ) ;
104+
98105 }
99106
100107 sendSettings ( ) {
Original file line number Diff line number Diff line change @@ -182,15 +182,4 @@ export default class BuildApi {
182182 }
183183 } ) ;
184184 }
185-
186- sendAnalytics ( type , parcel ) {
187- const url = `${ this . _url } /analytics/${ type } ` ;
188- $ . ajax ( {
189- url : url ,
190- type : "POST" ,
191- data : JSON . stringify ( parcel ) ,
192- contentType : "application/json" ,
193- dataType : "json" ,
194- } ) ;
195- }
196185}
You can’t perform that action at this time.
0 commit comments