diff options
author | Kristóf Marussy <kristof@marussy.com> | 2021-05-30 00:18:13 +0200 |
---|---|---|
committer | Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com> | 2021-05-30 21:25:23 +0530 |
commit | 1af3e44a1c4fe52706dbc79cbee7d1160cd417ab (patch) | |
tree | 4a9f5c6f348f01858c9ddb4bd88e6df532812d22 /recipes/pleroma/webview.js | |
parent | Fixing unread count in telegram-react (diff) | |
download | ferdium-recipes-1af3e44a1c4fe52706dbc79cbee7d1160cd417ab.tar.gz ferdium-recipes-1af3e44a1c4fe52706dbc79cbee7d1160cd417ab.tar.zst ferdium-recipes-1af3e44a1c4fe52706dbc79cbee7d1160cd417ab.zip |
Add Pleroma recipe
Pleroma is lightweight fediverse server: https://pleroma.social/
Diffstat (limited to 'recipes/pleroma/webview.js')
-rw-r--r-- | recipes/pleroma/webview.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/recipes/pleroma/webview.js b/recipes/pleroma/webview.js new file mode 100644 index 0000000..d08216d --- /dev/null +++ b/recipes/pleroma/webview.js | |||
@@ -0,0 +1,14 @@ | |||
1 | module.exports = (Ferdi) => { | ||
2 | const titleRegex = /^\((\d+)\)/; | ||
3 | |||
4 | const getMessages = () => { | ||
5 | let directCount = 0; | ||
6 | const matchArr = document.title.match(titleRegex); | ||
7 | if (matchArr) { | ||
8 | directCount = parseInt(matchArr[1], 10); | ||
9 | } | ||
10 | Ferdi.setBadge(directCount, 0); | ||
11 | }; | ||
12 | |||
13 | Ferdi.loop(getMessages); | ||
14 | }; | ||