notification click err: null

dev/chat
Lei OT 2 years ago
parent b95fdd12d6
commit 13ae99945b

@ -375,6 +375,7 @@ export const whatsappError = {
* 系统弹窗通知 * 系统弹窗通知
*/ */
export const handleNotification = (title, _options) => { export const handleNotification = (title, _options) => {
var notification;
const options = { const options = {
requireInteraction: true, // 设置手动关闭 requireInteraction: true, // 设置手动关闭
tag: 'global-sales-notification', // 通知ID同类通知建议设置相同ID避免通知过多遮挡桌面 tag: 'global-sales-notification', // 通知ID同类通知建议设置相同ID避免通知过多遮挡桌面
@ -384,11 +385,11 @@ export const handleNotification = (title, _options) => {
// 检查用户是否同意接受通知 // 检查用户是否同意接受通知
if (Notification.permission === 'granted') { if (Notification.permission === 'granted') {
var notification = new Notification(title, options); notification = new Notification(title, options);
} else if (Notification.permission !== 'denied') { } else if (Notification.permission !== 'denied') {
Notification.requestPermission().then(function (permission) { Notification.requestPermission().then(function (permission) {
if (permission === 'granted') { if (permission === 'granted') {
var notification = new Notification(title, options); notification = new Notification(title, options);
} }
}); });
} else { } else {

Loading…
Cancel
Save