Notify Honeybadger when no id can be found for a welcome notification (#8831)
* Notify Honeybadger when no id can be found for a welcome notification Also add the event's target's text to the tracking data for a welcome notification's click event. * Destructure text and title from event.target
This commit is contained in:
parent
019ce5e0d8
commit
178ee374ff
1 changed files with 7 additions and 3 deletions
|
|
@ -25,9 +25,13 @@
|
|||
*
|
||||
* @param {Event} The click event on the notification.
|
||||
*/
|
||||
function trackNotification(e) {
|
||||
let title = e.target.parentElement.id
|
||||
ahoy.track("Clicked Welcome Notification", { title });
|
||||
function trackNotification(event) {
|
||||
const { parentElement: { id: title }, text } = event.target;
|
||||
if (!title) {
|
||||
Honeybadger.notify(`Could not find parentElement.id when clicking on event target text: ${text}`);
|
||||
}
|
||||
|
||||
ahoy.track("Clicked Welcome Notification", { title, text });
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue