mirror of https://github.com/OCA/web.git
[MIG] web_notify: Migration to 16.0
parent
dfa4146efc
commit
50dcada5f1
|
@ -6,7 +6,7 @@
|
||||||
"name": "Web Notify",
|
"name": "Web Notify",
|
||||||
"summary": """
|
"summary": """
|
||||||
Send notification messages to user""",
|
Send notification messages to user""",
|
||||||
"version": "15.0.1.0.0",
|
"version": "16.0.1.0.0",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"author": "ACSONE SA/NV," "AdaptiveCity," "Odoo Community Association (OCA)",
|
"author": "ACSONE SA/NV," "AdaptiveCity," "Odoo Community Association (OCA)",
|
||||||
"development_status": "Production/Stable",
|
"development_status": "Production/Stable",
|
||||||
|
|
|
@ -3,9 +3,9 @@ import {browser} from "@web/core/browser/browser";
|
||||||
import {registry} from "@web/core/registry";
|
import {registry} from "@web/core/registry";
|
||||||
|
|
||||||
export const webNotificationService = {
|
export const webNotificationService = {
|
||||||
dependencies: ["notification"],
|
dependencies: ["bus_service", "notification"],
|
||||||
|
|
||||||
start(env, {notification}) {
|
start(env, {bus_service, notification}) {
|
||||||
let webNotifTimeouts = {};
|
let webNotifTimeouts = {};
|
||||||
/**
|
/**
|
||||||
* Displays the web notification on user's screen
|
* Displays the web notification on user's screen
|
||||||
|
@ -28,17 +28,15 @@ export const webNotificationService = {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
env.bus.on("WEB_CLIENT_READY", null, async () => {
|
|
||||||
const legacyEnv = owl.Component.env;
|
bus_service.addEventListener("notification", ({detail: notifications}) => {
|
||||||
legacyEnv.services.bus_service.onNotification(this, (notifications) => {
|
for (const {payload, type} of notifications) {
|
||||||
for (const {payload, type} of notifications) {
|
if (type === "web.notify") {
|
||||||
if (type === "web.notify") {
|
displaywebNotification(payload);
|
||||||
displaywebNotification(payload);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
legacyEnv.services.bus_service.startPolling();
|
|
||||||
});
|
});
|
||||||
|
bus_service.start();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue