Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gdpr false by default #41

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ BSD 3-Clause License

Original work Copyright (c) 2018, DPKit
Modified work Copyright (c) 2019, Empreinte Digitale
Modified work Copyright (c) 2020, Anvil Interactive
bouteillerAlan marked this conversation as resolved.
Show resolved Hide resolved
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
8 changes: 7 additions & 1 deletion src/components/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ export default class Main extends React.Component {
this.setState({isModalVisible: this.isModalVisible(false)})
}

acceptAndHideAll(e) {
this.props.manager.acceptAll()
this.props.manager.saveAndApplyConsents()
this.setState({isModalVisible: this.isModalVisible(false)})
}

render() {
const {config, t, manager, ns} = this.props
const isNoticeVisible = this.isNoticeVisible()
Expand All @@ -89,7 +95,7 @@ export default class Main extends React.Component {
ns={ns}
config={config}
onHideRequest={this.hideModal}
onSaveRequest={this.saveAndHideAll}
onSaveRequest={this.acceptAndHideAll}
manager={manager}
/>
</div>
Expand Down
6 changes: 6 additions & 0 deletions src/consent-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ export default class ConsentManager {
})
}

acceptAll(){
this.config.apps.map((app) => {
this.updateConsent(app, true)
})
}

updateConsent(app, value){
if (app.required && !value) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/orejime.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const defaultConfig = {
stringifyCookie: JSON.stringify.bind(JSON),
parseCookie: JSON.parse.bind(JSON),
privacyPolicy: '',
default: true,
default: false,
felixgirault marked this conversation as resolved.
Show resolved Hide resolved
mustConsent: false,
mustNotice: false,
implicitConsent: false,
Expand Down