From 60db7b16941a20ef1459ceb0e21ad33c23872854 Mon Sep 17 00:00:00 2001 From: some random guy Date: Wed, 9 Dec 2020 20:24:28 +0100 Subject: [PATCH] fix notifications --- gulp/res/js/yous.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gulp/res/js/yous.js b/gulp/res/js/yous.js index a2a3b2b2..bc42f84c 100644 --- a/gulp/res/js/yous.js +++ b/gulp/res/js/yous.js @@ -68,10 +68,14 @@ const handleNewYous = (e) => { } try { console.log('attempting to send notification', postYou); + const postData = e.detail.json; new Notification(`${quotesYou ? 'New quote in: ' : ''}${document.title}`, { body: postData.nomarkup ? postData.nomarkup.substring(0,100) : '' }); - } catch (e) { /* notification cant send for some reason -- user revoked perms in browser? */ } + } catch (e) { + // notification cant send for some reason -- user revoked perms in browser? + console.log('failed to send notification', e); + } } }