aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-08-16 23:13:06 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-08-16 23:13:06 +0530
commitbbed06e2ba255199703343625129712ef7707697 (patch)
tree19a525fbd1d621a6e561b1a687195269e54f43d5 /src/webview
parentchore: update outdated node_modules (#1807) (diff)
downloadferdium-app-bbed06e2ba255199703343625129712ef7707697.tar.gz
ferdium-app-bbed06e2ba255199703343625129712ef7707697.tar.zst
ferdium-app-bbed06e2ba255199703343625129712ef7707697.zip
Revert "chore: update outdated node_modules (#1807)"
Diffstat (limited to 'src/webview')
-rw-r--r--src/webview/notifications.js19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/webview/notifications.js b/src/webview/notifications.js
index 73cdb89d4..205a3220c 100644
--- a/src/webview/notifications.js
+++ b/src/webview/notifications.js
@@ -1,25 +1,22 @@
1import { ipcRenderer } from 'electron'; 1import { ipcRenderer } from 'electron';
2import { v1 as uuidV1 } from 'uuid'; 2import uuidV1 from 'uuid/v1';
3 3
4const debug = require('debug')('Ferdi:Notifications'); 4const debug = require('debug')('Ferdi:Notifications');
5 5
6export class NotificationsHandler { 6export class NotificationsHandler {
7 onNotify = data => data; 7 onNotify = (data) => data;
8 8
9 displayNotification(title, options) { 9 displayNotification(title, options) {
10 return new Promise(resolve => { 10 return new Promise((resolve) => {
11 debug('New notification', title, options); 11 debug('New notification', title, options);
12 12
13 const notificationId = uuidV1(); 13 const notificationId = uuidV1();
14 14
15 ipcRenderer.sendToHost( 15 ipcRenderer.sendToHost('notification', this.onNotify({
16 'notification', 16 title,
17 this.onNotify({ 17 options,
18 title, 18 notificationId,
19 options, 19 }));
20 notificationId,
21 }),
22 );
23 20
24 ipcRenderer.once(`notification-onclick:${notificationId}`, () => { 21 ipcRenderer.once(`notification-onclick:${notificationId}`, () => {
25 resolve(); 22 resolve();