Skip to content

Bug/CLARK-CLIENT-1/fix expression changed after checked error - #2242

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/bug/clark-client-1-ng0100-fix
Open

Bug/CLARK-CLIENT-1/fix expression changed after checked error#2242
sentry[bot] wants to merge 1 commit into
mainfrom
seer/bug/clark-client-1-ng0100-fix

Conversation

@sentry

@sentry sentry Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

This PR fixes the ExpressionChangedAfterItHasBeenCheckedError (NG0100) occurring in ClarkComponent related to the newsletter banner.

Root Cause:
The checkShowSubscriptionBanner() method in SubscriptionAgreementService was causing a synchronous state flip. When localStorage did not contain showSubscriptionBanner, setShowSubscriptionBanner(false) was called, correctly setting this.showSubscriptionBanner to false and updating localStorage. However, the method then continued to re-evaluate this.showSubscriptionBanner using a stale local banner variable (which was still null), causing it to be incorrectly set to true. On the subsequent Angular change detection cycle, the value from localStorage was correctly read as false, leading to a true to false change between checks.

Fix:
Added return statements immediately after each call to this.setShowSubscriptionBanner(false) within checkShowSubscriptionBanner(). This ensures that once this.showSubscriptionBanner is correctly set to false (and localStorage updated), the method exits, preventing the subsequent re-evaluation with the stale banner variable that caused the state flip.

Fixes CLARK-CLIENT-1

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

Successfully merging this pull request may close these issues.

0 participants