Skip to content

Commit

Permalink
feat: notification
Browse files Browse the repository at this point in the history
Update notification.mjs
  • Loading branch information
VirgilClyne committed Dec 12, 2024
1 parent 8e2fb4d commit 94c0feb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/notification.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,25 @@ import { Console } from "../polyfill/Console.mjs";
*
*/
export function notification(title = `ℹ️ ${$app} 通知`, subtitle = "", body = "", content = {}) {
const mutableContent = MutableContent(content);
switch ($app) {
case "Surge":
case "Loon":
case "Stash":
case "Egern":
case "Shadowrocket":
default:
$notification.post(title, subtitle, body, MutableContent(content));
$notification.post(title, subtitle, body, mutableContent);
break;
case "Quantumult X":
$notify(title, subtitle, body, MutableContent(content));
$notify(title, subtitle, body, mutableContent);
break;
case "Node.js":
break;
}
Console.info(...["==============📣系统通知📣==============", title, subtitle, body, JSON.stringify(MutableContent(content), null, 2)]);
Console.group("📣 系统通知");
Console.log(title, subtitle, body, JSON.stringify(mutableContent, null, 2));
Console.groupEnd();
}

const MutableContent = content => {
Expand Down

0 comments on commit 94c0feb

Please sign in to comment.