notification: remove dead code (notification class always present)
This commit is contained in:
@@ -7,7 +7,6 @@ import { notifications } from '../core/notifications.js';
|
||||
|
||||
const uiNotifications = {
|
||||
show(title, message) {
|
||||
if (notifications && typeof notifications.addNotification === 'function') {
|
||||
const normalizedTitle = String(title || '').toLowerCase();
|
||||
let icon = 'fa-info-circle';
|
||||
let iconClass = 'upload';
|
||||
@@ -37,27 +36,6 @@ const uiNotifications = {
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
let notification = document.querySelector('.notification');
|
||||
if (!notification) {
|
||||
notification = document.createElement('div');
|
||||
notification.classList.add('notification', 'hidden');
|
||||
notification.innerHTML = `
|
||||
<div class="notification-title">${title}</div>
|
||||
<div class="notification-message">${message}</div>
|
||||
`;
|
||||
document.body.appendChild(notification);
|
||||
} else {
|
||||
notification.querySelector('.notification-title').textContent = title;
|
||||
notification.querySelector('.notification-message').textContent = message;
|
||||
}
|
||||
|
||||
notification.classList.remove('hidden');
|
||||
|
||||
setTimeout(() => {
|
||||
notification.classList.add('hidden');
|
||||
}, 5000);
|
||||
}
|
||||
};
|
||||
|
||||
export { uiNotifications };
|
||||
|
||||
Reference in New Issue
Block a user