refactor(js): avoid use of window.XXX and move to import/export
- change worker: do not cache html pages (not necessary) - remove use of window.XXX and maximize import/export, this will provide more clarety, show circular dependencies + you will benefit IDE help
This commit is contained in:
@@ -3,9 +3,11 @@
|
||||
* Isolates notification rendering policy from ui.js.
|
||||
*/
|
||||
|
||||
import { notifications } from '../core/notifications.js';
|
||||
|
||||
const uiNotifications = {
|
||||
show(title, message) {
|
||||
if (window.notifications && typeof window.notifications.addNotification === 'function') {
|
||||
if (notifications && typeof notifications.addNotification === 'function') {
|
||||
const normalizedTitle = String(title || '').toLowerCase();
|
||||
let icon = 'fa-info-circle';
|
||||
let iconClass = 'upload';
|
||||
@@ -27,7 +29,7 @@ const uiNotifications = {
|
||||
iconClass = 'success';
|
||||
}
|
||||
|
||||
window.notifications.addNotification({
|
||||
notifications.addNotification({
|
||||
icon,
|
||||
iconClass,
|
||||
title: title || '',
|
||||
@@ -58,4 +60,4 @@ const uiNotifications = {
|
||||
}
|
||||
};
|
||||
|
||||
window.uiNotifications = uiNotifications;
|
||||
export { uiNotifications };
|
||||
|
||||
Reference in New Issue
Block a user