fix(#24,#25,#26,#27,#30): action按钮顺序; group边界; Notification权限; queue catch; 新增功能测试
This commit is contained in:
+10
-2
@@ -260,10 +260,18 @@ if (typeof window !== 'undefined') {
|
||||
|
||||
// Notification API — 页面不可见时自动发送系统通知
|
||||
enhancedMeToast._notify = (toast) => {
|
||||
if (typeof Notification === 'undefined' || Notification.permission !== 'granted') return;
|
||||
if (typeof Notification === 'undefined') return;
|
||||
if (Notification.permission === 'denied') return;
|
||||
if (!document.hidden) return;
|
||||
if (Notification.permission === 'default') {
|
||||
Notification.requestPermission().then(p => { if (p === 'granted') sendNotification(toast); });
|
||||
return;
|
||||
}
|
||||
sendNotification(toast);
|
||||
};
|
||||
const sendNotification = (toast) => {
|
||||
try {
|
||||
new Notification(toast.title || toast.type, { body: toast.message, icon: '/favicon.ico' });
|
||||
new Notification(toast.title || toast.type, { body: toast.message });
|
||||
} catch (_) {}
|
||||
};
|
||||
Toast.on('afterShow', (toast) => {
|
||||
|
||||
Reference in New Issue
Block a user