From 5705d58f2d7f53c3e79dc10464c13620a317c9b9 Mon Sep 17 00:00:00 2001 From: André Oliveira <37463445+SpecialAro@users.noreply.github.com> Date: Sat, 17 Feb 2024 15:27:03 +0000 Subject: chore: fix notification "option" clone (#1580) --- src/webview/recipe.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/webview/recipe.ts b/src/webview/recipe.ts index f2a13f224..148ea6fab 100644 --- a/src/webview/recipe.ts +++ b/src/webview/recipe.ts @@ -44,7 +44,7 @@ import { } from './spellchecker'; import { DEFAULT_APP_SETTINGS } from '../config'; -import { ifUndefined, safeParseInt } from '../jsUtils'; +import { cleanseJSObject, ifUndefined, safeParseInt } from '../jsUtils'; import { AppStore } from '../@types/stores.types'; import Service from '../models/Service'; @@ -124,8 +124,14 @@ contextBridge.exposeInMainWorld('ferdium', { safeParseInt(text), setDialogTitle: (title: string | null | undefined) => dialogTitleHandler.setDialogTitle(title), - displayNotification: (title: string, options: any) => - notificationsHandler.displayNotification(title, options), + displayNotification: (title: string, options: any) => { + notificationsHandler.displayNotification( + title, + // The following line is needed so that a proper clone of the "options" object is made. + // This line was causing issues with some services. + cleanseJSObject(options), + ); + }, getDisplayMediaSelector, }); -- cgit v1.2.3-54-g00ecf