Skip to content

Commit

Permalink
fix: disable ErrorBoundaries for a first run, fixes #1172
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed Feb 11, 2019
1 parent 09e48eb commit 2a834c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/global/generation.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
let generation = 1
let hotComparisonCounter = 0
let hotComparisonRuns = 0
const nullFunction = () => {}
let onHotComparisonOpen = nullFunction
let onHotComparisonElement = nullFunction
Expand All @@ -13,7 +14,8 @@ export const setComparisonHooks = (open, element, close) => {

export const getElementComparisonHook = () => onHotComparisonElement

export const hotComparisonOpen = () => hotComparisonCounter > 0
export const hotComparisonOpen = () =>
hotComparisonCounter > 0 && hotComparisonRuns > 0

const incrementHot = () => {
if (!hotComparisonCounter) {
Expand All @@ -25,6 +27,7 @@ const decrementHot = () => {
hotComparisonCounter--
if (!hotComparisonCounter) {
onHotComparisonClose()
hotComparisonRuns++
}
}

Expand Down

0 comments on commit 2a834c2

Please sign in to comment.