Fix preference panel close returning to banner when consent exists
When a visitor with existing consent opened the preference panel via the floating settings button and closed it, the state was always set to "banner" instead of "hidden". Now check hasConsent so closing the panel returns to the floating button when preferences are already saved. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -122,7 +122,7 @@ export class ProboThemedBanner extends HTMLElement {
|
||||
});
|
||||
|
||||
this.shadow.querySelector("[data-action=back]")?.addEventListener("click", () => {
|
||||
root.setState("banner");
|
||||
root.setState(root.client.hasConsent ? "hidden" : "banner");
|
||||
});
|
||||
|
||||
this.shadow.addEventListener("click", (e: Event) => {
|
||||
|
||||
Reference in New Issue
Block a user