diff options
author | 2021-10-23 19:16:01 +0500 | |
---|---|---|
committer | 2021-10-23 19:46:01 +0530 | |
commit | 4d02744dfab8a49075b82a5ddbdc02e08c7e8a66 (patch) | |
tree | dc7b08818a8f116d41886924552c92719c4d081a /src/webview/lib/RecipeWebview.js | |
parent | chore: upgrade npm modules (diff) | |
download | ferdium-app-4d02744dfab8a49075b82a5ddbdc02e08c7e8a66.tar.gz ferdium-app-4d02744dfab8a49075b82a5ddbdc02e08c7e8a66.tar.zst ferdium-app-4d02744dfab8a49075b82a5ddbdc02e08c7e8a66.zip |
Add active dialog title feature (#2114)
https://github.com/getferdi/ferdi/issues/1280
WhatsApp-like services can set active dialog title to the app title eg. Ferdi - WhatsApp - Contact Name
Diffstat (limited to 'src/webview/lib/RecipeWebview.js')
-rw-r--r-- | src/webview/lib/RecipeWebview.js | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/webview/lib/RecipeWebview.js b/src/webview/lib/RecipeWebview.js index f1d493e7c..ebe88ed85 100644 --- a/src/webview/lib/RecipeWebview.js +++ b/src/webview/lib/RecipeWebview.js | |||
@@ -5,8 +5,14 @@ import { pathExistsSync, readFileSync, existsSync } from 'fs-extra'; | |||
5 | const debug = require('debug')('Ferdi:Plugin:RecipeWebview'); | 5 | const debug = require('debug')('Ferdi:Plugin:RecipeWebview'); |
6 | 6 | ||
7 | class RecipeWebview { | 7 | class RecipeWebview { |
8 | constructor(badgeHandler, notificationsHandler, sessionHandler) { | 8 | constructor( |
9 | badgeHandler, | ||
10 | dialogTitleHandler, | ||
11 | notificationsHandler, | ||
12 | sessionHandler, | ||
13 | ) { | ||
9 | this.badgeHandler = badgeHandler; | 14 | this.badgeHandler = badgeHandler; |
15 | this.dialogTitleHandler = dialogTitleHandler; | ||
10 | this.notificationsHandler = notificationsHandler; | 16 | this.notificationsHandler = notificationsHandler; |
11 | this.sessionHandler = sessionHandler; | 17 | this.sessionHandler = sessionHandler; |
12 | 18 | ||
@@ -59,6 +65,17 @@ class RecipeWebview { | |||
59 | } | 65 | } |
60 | 66 | ||
61 | /** | 67 | /** |
68 | * Set the active dialog title to the app title | ||
69 | * | ||
70 | * @param {string | undefined | null} title Set the active dialog title | ||
71 | * to the app title | ||
72 | * eg. WhatsApp contact name | ||
73 | */ | ||
74 | setDialogTitle(title) { | ||
75 | this.dialogTitleHandler.setDialogTitle(title); | ||
76 | } | ||
77 | |||
78 | /** | ||
62 | * Safely parse the given text into an integer | 79 | * Safely parse the given text into an integer |
63 | * | 80 | * |
64 | * @param {string | number | undefined | null} text to be parsed | 81 | * @param {string | number | undefined | null} text to be parsed |
@@ -127,7 +144,10 @@ class RecipeWebview { | |||
127 | } | 144 | } |
128 | 145 | ||
129 | clearStorageData(serviceId, targetsToClear) { | 146 | clearStorageData(serviceId, targetsToClear) { |
130 | ipcRenderer.send('clear-storage-data', { serviceId, targetsToClear }); | 147 | ipcRenderer.send('clear-storage-data', { |
148 | serviceId, | ||
149 | targetsToClear, | ||
150 | }); | ||
131 | } | 151 | } |
132 | 152 | ||
133 | releaseServiceWorkers() { | 153 | releaseServiceWorkers() { |