Skip to content

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

@xOctave

Description

@xOctave

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'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions