aboutsummaryrefslogtreecommitdiffstats
path: root/src/sw-nwc.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/sw-nwc.js')
-rw-r--r--src/sw-nwc.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/sw-nwc.js b/src/sw-nwc.js
index 8267b6b..968be91 100644
--- a/src/sw-nwc.js
+++ b/src/sw-nwc.js
@@ -29,6 +29,17 @@ self.addEventListener('push', (e) => {
} catch (err) {
console.warn('[sw-nwc] auto-answer failed:', err && err.message);
}
+ // handled-with-a-heads-up: e.g. an invoice was minted while closed and
+ // the user should open Hal to complete the receive
+ if (handled && handled.notify) {
+ await self.registration.showNotification(handled.notify.title, {
+ body: handled.notify.body,
+ icon: 'icon-192.png', badge: 'icon-192.png',
+ tag: 'nwc-incoming', renotify: true,
+ data: { url: './' },
+ });
+ return;
+ }
if (handled) return;
await self.registration.showNotification('Payment request', {
body: 'An app is asking your wallet to pay. Open Hal to approve.',