Skip to content

Commit 2a834c2

Browse files
committed
fix: disable ErrorBoundaries for a first run, fixes #1172
1 parent 09e48eb commit 2a834c2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/global/generation.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
let generation = 1
22
let hotComparisonCounter = 0
3+
let hotComparisonRuns = 0
34
const nullFunction = () => {}
45
let onHotComparisonOpen = nullFunction
56
let onHotComparisonElement = nullFunction
@@ -13,7 +14,8 @@ export const setComparisonHooks = (open, element, close) => {
1314

1415
export const getElementComparisonHook = () => onHotComparisonElement
1516

16-
export const hotComparisonOpen = () => hotComparisonCounter > 0
17+
export const hotComparisonOpen = () =>
18+
hotComparisonCounter > 0 && hotComparisonRuns > 0
1719

1820
const incrementHot = () => {
1921
if (!hotComparisonCounter) {
@@ -25,6 +27,7 @@ const decrementHot = () => {
2527
hotComparisonCounter--
2628
if (!hotComparisonCounter) {
2729
onHotComparisonClose()
30+
hotComparisonRuns++
2831
}
2932
}
3033

0 commit comments

Comments
 (0)