mirror of
https://github.com/Mastermindzh/react-cookie-consent.git
synced 2025-01-21 02:50:58 +01:00
When running in debug mode, the scroll liteneris always added regardless of weather the acceptOnScroll was set to true or false
This commit is contained in:
parent
98b401dc72
commit
f7a98c925d
@ -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