From 5c350b370cbe8430582d25b062c8de19fdec033b Mon Sep 17 00:00:00 2001 From: Vijay A Date: Mon, 26 Dec 2022 13:26:12 +0530 Subject: Minor refactoring --- src/webview/recipe.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/webview/recipe.ts') diff --git a/src/webview/recipe.ts b/src/webview/recipe.ts index dc3f39401..ed45192d3 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 } from '../jsUtils'; +import { ifUndefined, safeParseInt } from '../jsUtils'; import { AppStore } from '../@types/stores.types'; import Service from '../models/Service'; @@ -116,10 +116,15 @@ window.open = (url, frameName, features): WindowProxy | null => { // then overwrite the corresponding field of the window object by injected JS. contextBridge.exposeInMainWorld('ferdium', { open: window.open, - setBadge: (direct, indirect) => badgeHandler.setBadge(direct, indirect), - safeParseInt: text => badgeHandler.safeParseInt(text), - setDialogTitle: title => dialogTitleHandler.setDialogTitle(title), - displayNotification: (title, options) => + setBadge: ( + direct: string | number | null | undefined, + indirect: string | number | null | undefined, + ) => badgeHandler.setBadge(direct, indirect), + safeParseInt: (text: string | number | null | undefined) => + safeParseInt(text), + setDialogTitle: (title: string | null | undefined) => + dialogTitleHandler.setDialogTitle(title), + displayNotification: (title: string, options: any) => notificationsHandler.displayNotification(title, options), getDisplayMediaSelector, }); -- cgit v1.2.3-70-g09d2