Skip to content

Commit ee23309

Browse files
committed
added console logs
1 parent f582c49 commit ee23309

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

src/app/components/Diff.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,15 @@ function Diff(props: DiffProps): JSX.Element {
8080
return newObj; // return the cleaned state snapshot(s)
8181
};
8282

83+
console.log('previousDisplay before stateless cleaning: ', previous);
8384
const previousDisplay: StatelessCleaning = statelessCleaning(previous); // displays stateful data from the first snapshot that was taken before our current snapshot.
84-
85+
console.log('previousDisplay after stateless cleaning: ', previousDisplay);
8586
const delta: StatelessCleaning = diff(previousDisplay, snapshot); // diff function from 'jsondiffpatch' returns the difference in state between 'previousDisplay' and 'snapshot'
86-
87+
console.log('delta: ', delta);
8788
const html: StatelessCleaning = formatters.html.format(delta, previousDisplay); // formatters function from 'jsondiffpatch' returns an html string that shows the difference between delta and the previousDisplay
89+
console.log('html: ', html);
8890

91+
console.log(show);
8992
if (show)
9093
formatters.html.showUnchanged(); // shows unchanged values if we're on the '/diffRaw' path
9194
else formatters.html.hideUnchanged(); // hides unchanged values

src/app/components/DiffRoute.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const DiffRoute = (props: DiffRouteProps): JSX.Element => (
1919
</NavLink>
2020
</div>
2121
<Switch>
22-
<Route path='/diffRaw' render={() => <Diff snapshot={props.snapshot} show />} />
22+
<Route path='/diffRaw' render={() => <Diff snapshot={props.snapshot} />} />
2323
<Route path='/' render={() => <Diff snapshot={props.snapshot} show={false} />} />
2424
</Switch>
2525
</Router>

src/app/components/StateRoute/StateRoute.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ const StateRoute = (props: StateRouteProps) => {
3232
webMetrics, // from 'tabs[currentTab]' object in 'MainContainer'
3333
currLocation, // from 'tabs[currentTab]' object in 'MainContainer'
3434
} = props;
35-
35+
console.log('snapshot from StateRoute props: ', snapshot);
36+
console.log('snapshots from StateRoute props: ', snapshots);
37+
console.log('currLocation from StateRoute props', currLocation);
3638
const { tabs, currentTab }: MainState = useSelector((state: RootState) => state.main);
3739
const { hierarchy, sliderIndex, viewIndex } = tabs[currentTab];
3840

@@ -55,7 +57,7 @@ const StateRoute = (props: StateRouteProps) => {
5557
return <div className='noState'>{NO_STATE_MSG}</div>; // otherwise, inform the user that there has been no state change in the target/hooked application.
5658
};
5759

58-
const renderHistory: JSX.Element = () => {
60+
const renderHistory = () => {
5961
if (hierarchy) {
6062
// if hierarchy was initialized/created render the history
6163
return (

src/extension/background.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ chrome.runtime.onConnect.addListener((port) => {
205205
const { action, payload, tabId } = msg;
206206

207207
switch (action) {
208+
// import action comes through when the user uses the "upload" button on the front end to import an existing snapshot tree
208209
case 'import': // create a snapshot property on tabId and set equal to tabs object
209210
// may need do something like filter payload from stateless
210211
console.log('background import action tabsObj: ', tabsObj);
@@ -219,7 +220,9 @@ chrome.runtime.onConnect.addListener((port) => {
219220

220221
return true; // return true so that port remains open
221222

223+
// emptySnap actions comes through when the user uses the 'clear' button on the front end to clear the snapshot history and move slider back to 0 position
222224
case 'emptySnap':
225+
console.log('tabsObj on clear: ', tabsObj);
223226
tabsObj[tabId].snapshots = [tabsObj[tabId].snapshots[tabsObj[tabId].snapshots.length - 1]]; // reset snapshots to page last state recorded
224227
tabsObj[tabId].hierarchy.children = []; // resets hierarchy
225228
tabsObj[tabId].hierarchy.stateSnapshot = {

0 commit comments

Comments
 (0)