diff options
author | Markus Hatvan <markus_hatvan@aon.at> | 2021-09-29 08:33:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-29 08:33:01 +0200 |
commit | 20574717c4b54635a8b757fccce64f2a98614997 (patch) | |
tree | 0f671af98b8253b13149c7bf5262d0b137881ecf /src/webview/notifications.js | |
parent | 5.6.3-nightly.17 [skip ci] (diff) | |
download | ferdium-app-20574717c4b54635a8b757fccce64f2a98614997.tar.gz ferdium-app-20574717c4b54635a8b757fccce64f2a98614997.tar.zst ferdium-app-20574717c4b54635a8b757fccce64f2a98614997.zip |
chore: update various outdated node_modules (#1969)
Diffstat (limited to 'src/webview/notifications.js')
-rw-r--r-- | src/webview/notifications.js | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/webview/notifications.js b/src/webview/notifications.js index 205a3220c..22960d818 100644 --- a/src/webview/notifications.js +++ b/src/webview/notifications.js | |||
@@ -1,22 +1,26 @@ | |||
1 | import { ipcRenderer } from 'electron'; | 1 | import { ipcRenderer } from 'electron'; |
2 | import uuidV1 from 'uuid/v1'; | 2 | |
3 | import { v1 as uuidV1 } from 'uuid'; | ||
3 | 4 | ||
4 | const debug = require('debug')('Ferdi:Notifications'); | 5 | const debug = require('debug')('Ferdi:Notifications'); |
5 | 6 | ||
6 | export class NotificationsHandler { | 7 | export class NotificationsHandler { |
7 | onNotify = (data) => data; | 8 | onNotify = data => data; |
8 | 9 | ||
9 | displayNotification(title, options) { | 10 | displayNotification(title, options) { |
10 | return new Promise((resolve) => { | 11 | return new Promise(resolve => { |
11 | debug('New notification', title, options); | 12 | debug('New notification', title, options); |
12 | 13 | ||
13 | const notificationId = uuidV1(); | 14 | const notificationId = uuidV1(); |
14 | 15 | ||
15 | ipcRenderer.sendToHost('notification', this.onNotify({ | 16 | ipcRenderer.sendToHost( |
16 | title, | 17 | 'notification', |
17 | options, | 18 | this.onNotify({ |
18 | notificationId, | 19 | title, |
19 | })); | 20 | options, |
21 | notificationId, | ||
22 | }), | ||
23 | ); | ||
20 | 24 | ||
21 | ipcRenderer.once(`notification-onclick:${notificationId}`, () => { | 25 | ipcRenderer.once(`notification-onclick:${notificationId}`, () => { |
22 | resolve(); | 26 | resolve(); |