Skip to content

Commit 74ed980

Browse files
committed
Fix + code style
1 parent 4b90097 commit 74ed980

File tree

2 files changed

+55
-11
lines changed

2 files changed

+55
-11
lines changed

resources/js/electron-plugin/dist/server/api/notification.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,23 @@ import { Notification } from 'electron';
33
import { notifyLaravel } from "../utils";
44
const router = express.Router();
55
router.post('/', (req, res) => {
6-
const { title, body, subtitle, silent, icon, hasReply, timeoutType, replyPlaceholder, sound, urgency, actions, closeButtonText, toastXml, customEvent: event } = req.body;
6+
const { title, body, subtitle, silent, icon, hasReply, timeoutType, replyPlaceholder, sound, urgency, actions, closeButtonText, toastXml, event: customEvent } = req.body;
77
const eventName = customEvent !== null && customEvent !== void 0 ? customEvent : '\\Native\\Laravel\\Events\\Notifications\\NotificationClicked';
8-
const notification = new Notification({ title, body, subtitle, silent, icon, hasReply, timeoutType, replyPlaceholder, sound, urgency, actions, closeButtonText, toastXml });
8+
const notification = new Notification({
9+
title,
10+
body,
11+
subtitle,
12+
silent,
13+
icon,
14+
hasReply,
15+
timeoutType,
16+
replyPlaceholder,
17+
sound,
18+
urgency,
19+
actions,
20+
closeButtonText,
21+
toastXml
22+
});
923
notification.on("click", (event) => {
1024
notifyLaravel('events', {
1125
event: eventName,
Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,54 @@
1-
import express from 'express'
2-
import { Notification } from 'electron'
1+
import express from 'express';
2+
import { Notification } from 'electron';
33
import {notifyLaravel} from "../utils";
44
const router = express.Router();
55

66
router.post('/', (req, res) => {
7-
const {title, body, subtitle, silent, icon, hasReply, timeoutType, replyPlaceholder, sound, urgency, actions, closeButtonText, toastXml, customEvent: event} = req.body
7+
const {
8+
title,
9+
body,
10+
subtitle,
11+
silent,
12+
icon,
13+
hasReply,
14+
timeoutType,
15+
replyPlaceholder,
16+
sound,
17+
urgency,
18+
actions,
19+
closeButtonText,
20+
toastXml,
21+
event: customEvent
22+
} = req.body;
23+
824
const eventName = customEvent ?? '\\Native\\Laravel\\Events\\Notifications\\NotificationClicked';
925

10-
const notification = new Notification({title, body, subtitle, silent, icon, hasReply, timeoutType, replyPlaceholder, sound, urgency, actions, closeButtonText, toastXml});
26+
const notification = new Notification({
27+
title,
28+
body,
29+
subtitle,
30+
silent,
31+
icon,
32+
hasReply,
33+
timeoutType,
34+
replyPlaceholder,
35+
sound,
36+
urgency,
37+
actions,
38+
closeButtonText,
39+
toastXml
40+
});
1141

12-
notification.on("click", (event)=>{
42+
notification.on("click", (event) => {
1343
notifyLaravel('events', {
1444
event: eventName,
1545
payload: JSON.stringify(event)
16-
})
17-
})
46+
});
47+
});
1848

19-
notification.show()
49+
notification.show();
2050

21-
res.sendStatus(200)
51+
res.sendStatus(200);
2252
});
2353

2454
export default router;

0 commit comments

Comments
 (0)