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

[Bug] getStatus() returns a value that is helpless in deciding about the consent status #151

Open
hsq125 opened this issue Oct 28, 2024 · 1 comment

Comments

@hsq125
Copy link

hsq125 commented Oct 28, 2024

Ngx-CookieConsent Version

6.0.0

CookieConsent Version

3.0.0

Angular CLI (or Nx CLI) Version

18.2.10

Node Version

v20.18.0

OS Version

22.04.1-Ubuntu SMP

Expected Behaviour

The getStatus() returns a value that represent the consent status.Something like

{deny: false, allow: true, dismiss: false}
or

{allow: 'allow'}
or

{allow: true}

For reference, documentation is

    /**
     * Gets the current cookie status.
     */
    getStatus(): NgcCookieConsentStatus;

Actual Behaviour

The getStatus() returns a value that gives no indication about the actual status.

{
    "deny": "deny",
    "allow": "allow",
    "dismiss": "dismiss"
}

It is impossible to do anything with that !!

Steps to reproduce the behaviour

Just invoke the service

console.log(this.ccService.getStatus().allow);
console.log(this.ccService.getStatus().deny);
console.log(!!this.ccService.getStatus().allow);
console.log(!!this.ccService.getStatus().deny);
console.log(this.ccService.getStatus());

you will get

app.component.ts:121 allow
app.component.ts:122 deny
app.component.ts:123 true
app.component.ts:124 true
app.component.ts:125 {deny: 'deny', allow: 'allow', dismiss: 'dismiss'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@hsq125 and others