@@ -14,42 +14,7 @@ const _ = require('lodash');
14
14
*/
15
15
// updating tree depending on current mode on the panel (pause, etc)
16
16
export default function updateAndSendSnapShotTree ( fiberRoot : FiberRoot ) : void {
17
-
18
- // This function compares trees with one another
19
- function isIdentical ( tree1 , tree2 ) {
20
- // Check if both are null
21
- if ( ! tree1 && ! tree2 ) return true ;
22
-
23
- // Check if either of them is null
24
- if ( ! tree1 || ! tree2 ) return false ;
25
-
26
- // Get the keys
27
- const tree1Keys = Object . keys ( tree1 ) ;
28
- const tree2Keys = Object . keys ( tree2 ) ;
29
-
30
- // Check if length of keys is different
31
- if ( tree1Keys . length !== tree2Keys . length ) return false ;
32
-
33
- // Check keys and values
34
- for ( let key of tree1Keys ) {
35
- const val1 = tree1 [ key ] ;
36
- const val2 = tree2 [ key ] ;
37
-
38
- const areObjects = isObject ( val1 ) && isObject ( val2 ) ;
39
- if (
40
- ( areObjects && ! isIdentical ( val1 , val2 ) ) ||
41
- ( ! areObjects && val1 !== val2 )
42
- ) {
43
- return false ;
44
- }
45
- }
46
- return true ;
47
- }
48
-
49
- function isObject ( object ) {
50
- return object != null && typeof object === 'object' ;
51
- }
52
-
17
+
53
18
// This is the currently active root fiber(the mutable root of the tree)
54
19
const { current } = fiberRoot ;
55
20
// Clear all of the legacy actions from old fiber tree because we are about to create a new one
@@ -66,9 +31,6 @@ export default function updateAndSendSnapShotTree(fiberRoot: FiberRoot): void {
66
31
// the postMessage action will be received on the content script to later update the tabsObj
67
32
// this will fire off everytime there is a change in test application
68
33
// convert the payload from a fiber tree to an object to avoid a data clone error when postMessage processes the argument
69
- console . log ( 'This is the payload, baby: ' , payload ) ;
70
- const clonedDeepPayload = _ . cloneDeep ( payload ) ;
71
- console . log ( 'cloneDeepPayload tree' , clonedDeepPayload ) ;
72
34
// compare payload and clonedDeepPayload with isIdentical
73
35
// console.log('are they identical?', isIdentical(payload, clonedDeepPayload));
74
36
// console.log('typeof payload', typeof payload);
0 commit comments