Skip to content

Commit

Permalink
Fix: The data attribute last_action_date is automatically added int…
Browse files Browse the repository at this point in the history
…o the `cc-settings` cookie for users that accepts/rejects consent before the plugin update
  • Loading branch information
tg666 committed Feb 9, 2022
1 parent b8ab395 commit 18e16af
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.3.7] - 2021-02-09

### Fixed

- The data attribute `last_action_date` is automatically added into the `cc-settings` cookie for users that accepts/rejects consent before the plugin update.

## [0.3.6] - 2021-02-07

### Added
Expand Down Expand Up @@ -197,7 +203,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- The first version of the package has been released.

[unreleased]: https://github.com/68publishers/cookie-consent/compare/v0.3.6...main
[unreleased]: https://github.com/68publishers/cookie-consent/compare/v0.3.7...main
[0.3.7]: https://github.com/68publishers/cookie-consent/compare/v0.3.6...v0.3.7
[0.3.6]: https://github.com/68publishers/cookie-consent/compare/v0.3.5...v0.3.6
[0.3.5]: https://github.com/68publishers/cookie-consent/compare/v0.3.4...v0.3.5
[0.3.4]: https://github.com/68publishers/cookie-consent/compare/v0.3.3...v0.3.4
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "68publishers-cookie-consent",
"version": "0.3.6",
"version": "0.3.7",
"description": "Cookie consent wrapper based on orestbida/cookieconsent with GTM integration.",
"homepage": "http://www.68publishers.io/",
"main": "index.js",
Expand Down
9 changes: 2 additions & 7 deletions src/ConsentManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,9 @@ class ConsentManager {

_showModalAgainIfAnyStorageIsExpired() {
let lastActionDate = this._cookieConsent.get('data').last_action_date;
lastActionDate = lastActionDate ? new Date(lastActionDate) : undefined;

if (!lastActionDate) {
return;
}

lastActionDate = new Date(lastActionDate);

if ('Invalid Date' === lastActionDate || isNaN(lastActionDate)) {
if (!lastActionDate || 'Invalid Date' === lastActionDate || isNaN(lastActionDate)) {
this._updateLastActionDate();

return;
Expand Down

0 comments on commit 18e16af

Please sign in to comment.