Skip to content

Commit 4539b8b

Browse files
committed
added delay before initial state is sent
1 parent 2af846d commit 4539b8b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

package/linkFiber.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ module.exports = (snap, mode) => {
6565
const { _reactRootContainer: { _internalRoot } } = container;
6666
fiberRoot = _internalRoot;
6767
updateSnapShotTree();
68-
sendSnapshot();
68+
69+
// send the initial snapshot once the content script has started up
70+
window.addEventListener('message', ({ data: { action } }) => {
71+
if (action === 'contentScriptStarted') sendSnapshot();
72+
});
6973
};
7074
};

0 commit comments

Comments
 (0)