aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/vk
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/vk')
-rw-r--r--recipes/vk/package.json2
-rw-r--r--recipes/vk/webview.js18
2 files changed, 18 insertions, 2 deletions
diff --git a/recipes/vk/package.json b/recipes/vk/package.json
index e4b7dfa..e61c166 100644
--- a/recipes/vk/package.json
+++ b/recipes/vk/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "vk", 2 "id": "vk",
3 "name": "VK", 3 "name": "VK",
4 "version": "1.1.2", 4 "version": "1.1.3",
5 "license": "MIT", 5 "license": "MIT",
6 "repository": "https://github.com/meetfranz/recipe-vk", 6 "repository": "https://github.com/meetfranz/recipe-vk",
7 "config": { 7 "config": {
diff --git a/recipes/vk/webview.js b/recipes/vk/webview.js
index decec13..6756363 100644
--- a/recipes/vk/webview.js
+++ b/recipes/vk/webview.js
@@ -9,5 +9,21 @@ module.exports = Ferdi => {
9 Ferdi.setBadge(directs); 9 Ferdi.setBadge(directs);
10 }; 10 };
11 11
12 Ferdi.loop(getMessages); 12 const getActiveDialogTitle = () => {
13 const element = [
14 document.querySelector(
15 '.FCWindow--active .FCWindow__title .ConvoTitle__title',
16 ),
17 document.querySelector('.im-page_history-show ._im_page_peer_name'),
18 ].find(Boolean);
19
20 Ferdi.setDialogTitle(element ? element.textContent : null);
21 };
22
23 const loopFunc = () => {
24 getMessages();
25 getActiveDialogTitle();
26 };
27
28 Ferdi.loop(loopFunc);
13}; 29};