fix(#24,#25,#26,#27,#30): action按钮顺序; group边界; Notification权限; queue catch; 新增功能测试

This commit is contained in:
tianhao
2026-06-16 13:09:50 +08:00
parent 531438cc9c
commit 900e965ae6
3 changed files with 89 additions and 6 deletions
+10 -2
View File
@@ -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) => {