Skip to content

How to Detect Modal Close or Preferences Update? #13

@cristinaITdeveloper

Description

@cristinaITdeveloper

I’m using this library in my Next.js application, and I’ve implemented a button in the footer that opens the preferences modal using the openPreferences method.

Now, I’d like to detect when the modal is closed or when the user updates their preferences. I’ve tried listening for events such as preferences_updated or iubenda_preferences_updated, but they don’t seem to be triggered.

Additionally, I see there’s a dispatchUserPreferences method in the library, but I’m not sure how to use it effectively in this context. Could you please clarify:

  • What is the correct way to detect when the modal is closed or the preferences are updated?
  • How should dispatchUserPreferences be used in this case?

Any guidance or examples would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions