aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/messenger/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/messenger/webview.js')
-rw-r--r--recipes/messenger/webview.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/recipes/messenger/webview.js b/recipes/messenger/webview.js
index 45b4460..c90f4ad 100644
--- a/recipes/messenger/webview.js
+++ b/recipes/messenger/webview.js
@@ -1,4 +1,4 @@
1module.exports = Ferdi => { 1module.exports = Ferdium => {
2 const getMessages = () => { 2 const getMessages = () => {
3 let count = 0; 3 let count = 0;
4 4
@@ -9,7 +9,7 @@ module.exports = Ferdi => {
9 * see https://github.com/ferdium/ferdium-app/issues/1113#issuecomment-783409154 9 * see https://github.com/ferdium/ferdium-app/issues/1113#issuecomment-783409154
10 */ 10 */
11 if (isNotification) { 11 if (isNotification) {
12 count = Ferdi.safeParseInt(/^\((\d+)\)/.exec(document.title)[1]); 12 count = Ferdium.safeParseInt(/^\((\d+)\)/.exec(document.title)[1]);
13 } else { 13 } else {
14 /* 14 /*
15 * Notification case for direct messages, workaround by manavortex 15 * Notification case for direct messages, workaround by manavortex
@@ -33,13 +33,13 @@ module.exports = Ferdi => {
33 */ 33 */
34 const messageRequestsElement = document.querySelector('._5nxf'); 34 const messageRequestsElement = document.querySelector('._5nxf');
35 if (messageRequestsElement) { 35 if (messageRequestsElement) {
36 count += Ferdi.safeParseInt(messageRequestsElement.textContent); 36 count += Ferdium.safeParseInt(messageRequestsElement.textContent);
37 } 37 }
38 38
39 Ferdi.setBadge(count); 39 Ferdium.setBadge(count);
40 }; 40 };
41 41
42 Ferdi.loop(getMessages); 42 Ferdium.loop(getMessages);
43 43
44 localStorage.setItem( 44 localStorage.setItem(
45 '_cs_desktopNotifsEnabled', 45 '_cs_desktopNotifsEnabled',
@@ -49,8 +49,8 @@ module.exports = Ferdi => {
49 }), 49 }),
50 ); 50 );
51 51
52 if (typeof Ferdi.onNotify === 'function') { 52 if (typeof Ferdium.onNotify === 'function') {
53 Ferdi.onNotify(notification => { 53 Ferdium.onNotify(notification => {
54 if (typeof notification.title !== 'string') { 54 if (typeof notification.title !== 'string') {
55 notification.title = 55 notification.title =
56 ((notification.title.props || {}).content || [])[0] || 'Messenger'; 56 ((notification.title.props || {}).content || [])[0] || 'Messenger';