cookieconsent icon indicating copy to clipboard operation
cookieconsent copied to clipboard

[Bug]: Category with services - 'enabled' unexpected behaviour

Open frankykubo opened this issue 4 months ago • 0 comments

Expected Behavior

When I do not consent right away but open the setting modal instead, by default the category and all the services under it should be enabled. Thats happening.

When I click Save preferences, then, in onConsent function parameter (cookie), I get services object where there are by-config-enabled services included.

Current Behavior

When I click Save preferences in Settings modal before first consent, then, in onConsent function parameter (cookie), I get services object where there are NOT by-config-enabled services included.

Also, CookieConsent.acceptedService('test', 'analytics') is false, which should be true.

Steps to reproduce

Reproduced here, by setting updating analytics category:

analytics: {
      services: {
        test: {
          label: 'Test',
        },
      },
      enabled: true,
    },
  1. Click Manage preferences in UI
  2. Click Save preferences in UI
  3. See console, where parameter of onConsent is logged
  4. Look for services object, where under analytics, test should be included, but it is not.

Proposed fix or additional info.

No response

Version

3.0.0

On which browser do you see the issue?

No response

frankykubo avatar Feb 26 '24 10:02 frankykubo