For lightning I used a handler for force:showToast
event to capture toasts for edit/new actions on standard pop up when a record was edited/inserted. I would like to do the same in lwc.
I added a listener in the constructor and it works well only for my custom toasts, but doesn't work for standard toasts when I open a standard pop up. Is there a way to capture standard toasts in lwc?
constructor() {
super();
document.addEventListener('lightning__showtoast', this.handleToastEvent.bind(this))
}
handleToastEvent (){
console.log('toast')
}
Pop up is opened through NavigationMixin.Navigate
handleEditRecord(row) {
this[NavigationMixin.Navigate]({
type: 'standard__recordPage',
attributes: {
'recordId': row.Id,
'actionName': 'edit'
},
})
}