Skip to content

Commit

Permalink
Merge pull request #24 from germanbisurgi/feature/fix-double-cookie
Browse files Browse the repository at this point in the history
Feature/fix double cookie
  • Loading branch information
germanbisurgi authored Mar 21, 2024
2 parents 343a296 + be2fdb7 commit 2487c30
Show file tree
Hide file tree
Showing 4 changed files with 686 additions and 1,298 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Build and Test

on: [push, pull_request]

jobs:

e2e-test:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Node version
run: node -v
- name: Install
run: yarn install
- name: Test
run: yarn test
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"live-server": "^1.2.1",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.5"
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4"
},
"bugs": {
"url": "https://github.com/dmstr/cookie-consent/issues"
Expand Down
4 changes: 2 additions & 2 deletions src/cookie-consent.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ CookieConsent.prototype.add = function (consent) {
const value = this.get()
if (typeof value !== 'undefined' && !value.indexOf(consent) > -1) {
value.push(consent)
const options = this.mergeObjects(this.defaultsOptions, { value: value })
const options = this.mergeObjects(this.options, { value: value })
this.set(options)
return true
} else {
Expand All @@ -256,7 +256,7 @@ CookieConsent.prototype.remove = function (consent) {
const index = value.indexOf(consent)
if (index > -1) {
value.splice(index, 1)
const options = this.mergeObjects(this.defaultsOptions, { value: value })
const options = this.mergeObjects(this.options, { value: value })
this.set(options)
return true
} else {
Expand Down
Loading

0 comments on commit 2487c30

Please sign in to comment.