diff options
Diffstat (limited to 'src/webview/recipe.ts')
-rw-r--r-- | src/webview/recipe.ts | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/webview/recipe.ts b/src/webview/recipe.ts index b394f1517..148ea6fab 100644 --- a/src/webview/recipe.ts +++ b/src/webview/recipe.ts | |||
@@ -44,7 +44,7 @@ import { | |||
44 | } from './spellchecker'; | 44 | } from './spellchecker'; |
45 | 45 | ||
46 | import { DEFAULT_APP_SETTINGS } from '../config'; | 46 | import { DEFAULT_APP_SETTINGS } from '../config'; |
47 | import { ifUndefined, safeParseInt } from '../jsUtils'; | 47 | import { cleanseJSObject, ifUndefined, safeParseInt } from '../jsUtils'; |
48 | import { AppStore } from '../@types/stores.types'; | 48 | import { AppStore } from '../@types/stores.types'; |
49 | import Service from '../models/Service'; | 49 | import Service from '../models/Service'; |
50 | 50 | ||
@@ -124,8 +124,14 @@ contextBridge.exposeInMainWorld('ferdium', { | |||
124 | safeParseInt(text), | 124 | safeParseInt(text), |
125 | setDialogTitle: (title: string | null | undefined) => | 125 | setDialogTitle: (title: string | null | undefined) => |
126 | dialogTitleHandler.setDialogTitle(title), | 126 | dialogTitleHandler.setDialogTitle(title), |
127 | displayNotification: (title: string, options: any) => | 127 | displayNotification: (title: string, options: any) => { |
128 | notificationsHandler.displayNotification(title, options), | 128 | notificationsHandler.displayNotification( |
129 | title, | ||
130 | // The following line is needed so that a proper clone of the "options" object is made. | ||
131 | // This line was causing issues with some services. | ||
132 | cleanseJSObject(options), | ||
133 | ); | ||
134 | }, | ||
129 | getDisplayMediaSelector, | 135 | getDisplayMediaSelector, |
130 | }); | 136 | }); |
131 | 137 | ||
@@ -158,6 +164,7 @@ class RecipeController { | |||
158 | 'service-settings-update': 'updateServiceSettings', | 164 | 'service-settings-update': 'updateServiceSettings', |
159 | 'get-service-id': 'serviceIdEcho', | 165 | 'get-service-id': 'serviceIdEcho', |
160 | 'find-in-page': 'openFindInPage', | 166 | 'find-in-page': 'openFindInPage', |
167 | 'toggle-to-talk': 'toggleToTalk', | ||
161 | }; | 168 | }; |
162 | 169 | ||
163 | universalDarkModeInjected = false; | 170 | universalDarkModeInjected = false; |
@@ -483,6 +490,10 @@ class RecipeController { | |||
483 | }, 225), | 490 | }, 225), |
484 | ); | 491 | ); |
485 | } | 492 | } |
493 | |||
494 | toggleToTalk() { | ||
495 | this.recipe?.toggleToTalkFunc?.(); | ||
496 | } | ||
486 | } | 497 | } |
487 | 498 | ||
488 | /* eslint-disable no-new */ | 499 | /* eslint-disable no-new */ |