diff options
author | Vijay A <vraravam@users.noreply.github.com> | 2022-12-26 13:26:12 +0530 |
---|---|---|
committer | Vijay A <vraravam@users.noreply.github.com> | 2022-12-26 13:26:12 +0530 |
commit | 5c350b370cbe8430582d25b062c8de19fdec033b (patch) | |
tree | 55db1e27efd7159ea7c4dc42c0e115b531bc3b83 /src/webview/recipe.ts | |
parent | Upgrade 'nodejs' to '16.19.0' and 'pnpm' to '7.19.0' (diff) | |
download | ferdium-app-5c350b370cbe8430582d25b062c8de19fdec033b.tar.gz ferdium-app-5c350b370cbe8430582d25b062c8de19fdec033b.tar.zst ferdium-app-5c350b370cbe8430582d25b062c8de19fdec033b.zip |
Minor refactoring
Diffstat (limited to 'src/webview/recipe.ts')
-rw-r--r-- | src/webview/recipe.ts | 15 |
1 files changed, 10 insertions, 5 deletions
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 { | |||
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 } from '../jsUtils'; | 47 | import { 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 | ||
@@ -116,10 +116,15 @@ window.open = (url, frameName, features): WindowProxy | null => { | |||
116 | // then overwrite the corresponding field of the window object by injected JS. | 116 | // then overwrite the corresponding field of the window object by injected JS. |
117 | contextBridge.exposeInMainWorld('ferdium', { | 117 | contextBridge.exposeInMainWorld('ferdium', { |
118 | open: window.open, | 118 | open: window.open, |
119 | setBadge: (direct, indirect) => badgeHandler.setBadge(direct, indirect), | 119 | setBadge: ( |
120 | safeParseInt: text => badgeHandler.safeParseInt(text), | 120 | direct: string | number | null | undefined, |
121 | setDialogTitle: title => dialogTitleHandler.setDialogTitle(title), | 121 | indirect: string | number | null | undefined, |
122 | displayNotification: (title, options) => | 122 | ) => badgeHandler.setBadge(direct, indirect), |
123 | safeParseInt: (text: string | number | null | undefined) => | ||
124 | safeParseInt(text), | ||
125 | setDialogTitle: (title: string | null | undefined) => | ||
126 | dialogTitleHandler.setDialogTitle(title), | ||
127 | displayNotification: (title: string, options: any) => | ||
123 | notificationsHandler.displayNotification(title, options), | 128 | notificationsHandler.displayNotification(title, options), |
124 | getDisplayMediaSelector, | 129 | getDisplayMediaSelector, |
125 | }); | 130 | }); |