@@ -32,11 +32,11 @@ function MainContainer(): any {
32
32
const port = chrome . runtime . connect ( ) ;
33
33
34
34
// listen for a message containing snapshots from the background script
35
- port . onMessage . addListener ( ( message :{ action :string , payload :Record < string , unknown > , sourceTab :number } ) => {
35
+ port . onMessage . addListener ( ( message : { action : string , payload : Record < string , unknown > , sourceTab : number } ) => {
36
36
const { action, payload, sourceTab } = message ;
37
37
let maxTab ;
38
38
if ( ! sourceTab ) {
39
- const tabsArray :any = Object . keys ( payload ) ;
39
+ const tabsArray : any = Object . keys ( payload ) ;
40
40
maxTab = Math . max ( ...tabsArray ) ;
41
41
}
42
42
switch ( action ) {
@@ -75,23 +75,23 @@ function MainContainer(): any {
75
75
/**
76
76
* get set cookies for mixpanel analytics
77
77
**/
78
- useEffect ( ( ) => {
78
+ useEffect ( ( ) => {
79
79
/**
80
80
* create new user and attempt to read cookies
81
- */
81
+ */
82
82
const user = new MPID ( ) ;
83
83
/**
84
84
* If developing turn tracking off by setting user.debug to true;
85
- * End goal: set user.debug variable in npm run dev
85
+ * End goal: set an environment variable to automate this toggle
86
86
*/
87
- user . debug = true ;
87
+ user . debug = false ;
88
88
89
89
if ( ! user . debug ) {
90
90
//set current user cookie if it does not exist in cookies;
91
- if ( user . checkDocumentCookie ( document ) ) {
91
+ if ( user . checkDocumentCookie ( document ) ) {
92
92
user . getCookie ( ) ;
93
93
mixpanel . people . increment ( user . get_dId ( ) , "times" ) ;
94
- } else {
94
+ } else {
95
95
user . setCookie ( ) ;
96
96
mixpanel . people . set ( user . get_dId ( ) , { times : 1 } ) ;
97
97
}
@@ -132,7 +132,7 @@ function MainContainer(): any {
132
132
// if viewIndex is -1, then use the sliderIndex instead
133
133
const snapshotView = viewIndex === - 1 ? snapshots [ sliderIndex ] : snapshots [ viewIndex ] ;
134
134
// cleaning hierarchy and snapshotView from stateless data
135
- const statelessCleaning = ( obj :{ name ?:string ; componentData ?:object ; state ?:string | any ; stateSnaphot ?:object ; children ?:any [ ] ; } ) => {
135
+ const statelessCleaning = ( obj : { name ?: string ; componentData ?: object ; state ?: string | any ; stateSnaphot ?: object ; children ?: any [ ] ; } ) => {
136
136
const newObj = { ...obj } ;
137
137
if ( newObj . name === 'nameless' ) {
138
138
delete newObj . name ;
@@ -149,7 +149,7 @@ function MainContainer(): any {
149
149
if ( newObj . children ) {
150
150
newObj . children = [ ] ;
151
151
if ( obj . children . length > 0 ) {
152
- obj . children . forEach ( ( element :{ state ?:object | string , children ?:[ ] } ) => {
152
+ obj . children . forEach ( ( element : { state ?: object | string , children ?: [ ] } ) => {
153
153
if ( element . state !== 'stateless' || element . children . length > 0 ) {
154
154
const clean = statelessCleaning ( element ) ;
155
155
newObj . children . push ( clean ) ;
0 commit comments