mirror of
https://github.com/Mastermindzh/react-cookie-consent.git
synced 2025-01-20 18:41:44 +01:00
Merge pull request #42 from a-game/fix/acceptOnScroll-forced-in-debug
Fix: Debug mode overriding acceptOnScroll property
This commit is contained in:
commit
68a8301cd5
@ -66,8 +66,8 @@ class CookieConsent extends Component {
|
|||||||
this.setState({ visible: true });
|
this.setState({ visible: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
// if acceptOnScroll is set to true and cookie is undefined or debug is set to true, add a listener.
|
// if acceptOnScroll is set to true and (cookie is undefined or debug is set to true), add a listener.
|
||||||
if ((this.props.acceptOnScroll && Cookies.get(cookieName) === undefined) || debug) {
|
if (this.props.acceptOnScroll && (Cookies.get(cookieName) === undefined || debug)) {
|
||||||
window.addEventListener("scroll", this.handleScroll, { passive: true });
|
window.addEventListener("scroll", this.handleScroll, { passive: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user