@@ -10,8 +10,6 @@ const tabsObj = {};
1010// Will store Chrome web vital metrics and their corresponding values.
1111const metrics = { } ;
1212
13- let isRecordAfterJump = false ;
14-
1513// This function will create the first instance of the test app's tabs object
1614// which will hold test app's snapshots, link fiber tree info, chrome tab info, etc.
1715function createTabObj ( title ) {
@@ -99,12 +97,7 @@ function countCurrName(rootNode, name) {
9997function changeCurrLocation ( tabObj , rootNode , index , name ) {
10098 // index comes from the app's main reducer to locate the correct current location on tabObj
10199 // check if current node has the index wanted
102- console . log ( 'DEBUG >>> rootNode.index: ' , rootNode . index ) ;
103- console . log ( 'DEBUG >>> index: ' , index ) ;
104100 if ( rootNode . index === index ) {
105- console . log ( 'DEBUG >>> jump index: ' , index ) ;
106- console . log ( 'DEBUG >>> jump name: ' , name ) ;
107- console . log ( 'DEBUG >>> jump hierachy: ' , rootNode ) ;
108101 tabObj . currLocation = rootNode ;
109102 // Count number of nodes in the tree with name = next name.
110103 const currNameCount = countCurrName ( tabObj . hierarchy , name + 1 ) ;
@@ -257,7 +250,12 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
257250 case 'jumpToSnap' : {
258251 console . log ( 'DEBUG >>> in jumpToSnap action!' )
259252 changeCurrLocation ( tabsObj [ tabId ] , tabsObj [ tabId ] . hierarchy , index , name ) ;
260- isRecordAfterJump = true ;
253+ if ( portsArr . length > 0 ) {
254+ portsArr . forEach ( bg => bg . postMessage ( {
255+ action : 'setCurrentLocation' ,
256+ payload : tabsObj ,
257+ } ) ) ;
258+ }
261259 break ;
262260 }
263261 // This injects a script into the app that you're testing Reactime on,
@@ -343,6 +341,8 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
343341 break ;
344342 }
345343
344+ console . log ( "DEBUG >>> reached previousSnap" ) ;
345+
346346 // DUPLICATE SNAPSHOT CHECK
347347 const previousSnap = tabsObj [ tabId ] . currLocation . stateSnapshot . children [ 0 ] . componentData
348348 . actualDuration ;
@@ -353,9 +353,6 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
353353 if ( reloaded [ tabId ] ) {
354354 // don't add anything to snapshot storage if tab is reloaded for the initial snapshot
355355 reloaded [ tabId ] = false ;
356- } else if ( isRecordAfterJump ) {
357- console . log ( 'DEBUG >>> test currLocation: ' , tabsObj [ tabId ] . currLocation ) ;
358- isRecordAfterJump = false ;
359356 } else {
360357 tabsObj [ tabId ] . snapshots . push ( request . payload ) ;
361358 //! INVOKING buildHierarchy FIGURE OUT WHAT TO PASS IN!!!!
@@ -366,12 +363,6 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
366363 new Node ( request . payload , tabsObj [ tabId ] ) ,
367364 ) ;
368365 }
369- // else {
370- // sendToHierarchy(
371- // tabsObj[tabId],
372- // new NewNode(request.payload, tabsObj[tabId])
373- // );
374- // }
375366 }
376367 // sends new tabs obj to devtools
377368 if ( portsArr . length > 0 ) {
0 commit comments