diff --git a/source/ui/notifier.cpp b/source/ui/notifier.cpp index dd5cfd7..837ba0f 100644 --- a/source/ui/notifier.cpp +++ b/source/ui/notifier.cpp @@ -42,6 +42,15 @@ void Notifier::show(const std::string& text, Uint64 duration) { duration = NOTIFICATION_DURATION; } + // NUEVO: Limpiar notificación actual y cola (solo mostrar la última) + // Si hay una notificación activa, destruirla inmediatamente + current_notification_.reset(); + + // Vaciar cola completa (descartar notificaciones pendientes) + while (!notification_queue_.empty()) { + notification_queue_.pop(); + } + // Crear nueva notificación Notification notif; notif.text = text; @@ -52,8 +61,8 @@ void Notifier::show(const std::string& text, Uint64 duration) { notif.y_offset = -50.0f; // Comienza 50px arriba (fuera de pantalla) // NOTA: Los colores se obtienen dinámicamente desde ThemeManager en render() - // Añadir a cola - notification_queue_.push(notif); + // Activar inmediatamente como notificación actual (sin esperar en cola) + current_notification_ = std::make_unique(notif); } void Notifier::update(Uint64 current_time) {