chore: remove debug logging in toast controller
This commit is contained in:
@@ -24,24 +24,15 @@ export default class extends Controller {
|
||||
}
|
||||
|
||||
handleNotifications(event) {
|
||||
console.log('[VOUCHER DEBUG] showNotifications event received:', event)
|
||||
console.log('[VOUCHER DEBUG] event.detail:', event.detail)
|
||||
|
||||
// HTMX wraps the trigger value in an object with 'value' and 'elt' properties
|
||||
// event.detail.value contains the actual array from the HX-Trigger header
|
||||
const notifications = event.detail?.value || event.detail || []
|
||||
|
||||
console.log('[VOUCHER DEBUG] notifications array:', notifications)
|
||||
console.log('[VOUCHER DEBUG] notifications count:', Array.isArray(notifications) ? notifications.length : 'not an array')
|
||||
|
||||
if (Array.isArray(notifications)) {
|
||||
notifications.forEach((notification, index) => {
|
||||
console.log(`[VOUCHER DEBUG] Processing notification ${index}:`, notification)
|
||||
const className = this.getClassForType(notification.type)
|
||||
this.showToast(notification.message, className)
|
||||
})
|
||||
} else {
|
||||
console.error('[VOUCHER DEBUG] Notifications is not an array:', notifications)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,4 +57,4 @@ export default class extends Controller {
|
||||
|
||||
return typeMap[type] || 'toastify--info'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user