-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update notification button based on API response
No longer replace the entire button HTML from the personalisation API response. Instead, check the boolean "active" in the response: if active is true, user has subscribed to notifications. Update the button HTML accordingly by changing the button tracking attribute. When valid API response is received, also check if the button markup contains data-button-location and if so, append the value to the button tracking attribute. Also check if the button has data-button-text-unsubscribe and data-button-text-subscribe attributes; set custom button text if both data attributes are provided. Once the API response has been refactored on the backend to not return the entire button HTML, we should also remove passing the button location to the personalisation API in the JS and the corresponding test for it.
- Loading branch information
1 parent
98df79e
commit ce4d1a5
Showing
3 changed files
with
103 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters