MCPcopy
hub / github.com/vercel/hyper / notify

Function notify

app/notify.ts:4–16  ·  view source on GitHub ↗
(title: string, body = '', details: {error?: any} = {})

Source from the content-addressed store, hash-verified

2import {icon} from './config/paths';
3
4export default function notify(title: string, body = '', details: {error?: any} = {}) {
5 console.log(`[Notification] ${title}: ${body}`);
6 if (details.error) {
7 console.error(details.error);
8 }
9 if (app.isReady()) {
10 _createNotification(title, body);
11 } else {
12 app.on('ready', () => {
13 _createNotification(title, body);
14 });
15 }
16}
17
18const _createNotification = (title: string, body: string) => {
19 new Notification({title, body, ...(process.platform === 'linux' && {icon})}).show();

Callers 15

checkDeprecatedConfigFunction · 0.70
onChangeFunction · 0.70
updatePluginsFunction · 0.70
loadFunction · 0.70
onAppFunction · 0.70
onWindowClassFunction · 0.70
onWindowFunction · 0.70
decorateEntityFunction · 0.70
getDeprecatedConfigFunction · 0.70
logNotifyFunction · 0.50
newWindowFunction · 0.50

Calls 4

_createNotificationFunction · 0.85
onMethod · 0.80
logMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected