aboutsummaryrefslogtreecommitdiffstats
path: root/packages/service-preload/src/index.ts
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-01-27 00:17:22 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-02-08 21:43:17 +0100
commit9546dc2aa39ab096ccc723786e718a739d0bdaf9 (patch)
tree9c3afc6155cc59f6dd1235397230aaa15a5f8cec /packages/service-preload/src/index.ts
parentrefactor: Apply shared store patches in batches (diff)
downloadsophie-9546dc2aa39ab096ccc723786e718a739d0bdaf9.tar.gz
sophie-9546dc2aa39ab096ccc723786e718a739d0bdaf9.tar.zst
sophie-9546dc2aa39ab096ccc723786e718a739d0bdaf9.zip
refactor: Coding conventions
Make sure that files have a default import with the same name as the file whenever possible to reduce surprise. Also shuffles around some file names for better legibility. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'packages/service-preload/src/index.ts')
-rw-r--r--packages/service-preload/src/index.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/service-preload/src/index.ts b/packages/service-preload/src/index.ts
index 8b6630a..5383f42 100644
--- a/packages/service-preload/src/index.ts
+++ b/packages/service-preload/src/index.ts
@@ -18,7 +18,7 @@
18 * SPDX-License-Identifier: AGPL-3.0-only 18 * SPDX-License-Identifier: AGPL-3.0-only
19 */ 19 */
20 20
21import { ServiceToMainIpcMessage, webSource } from '@sophie/service-shared'; 21import { ServiceToMainIpcMessage, WebSource } from '@sophie/service-shared';
22import { ipcRenderer, webFrame } from 'electron'; 22import { ipcRenderer, webFrame } from 'electron';
23 23
24if (webFrame.parent === null) { 24if (webFrame.parent === null) {
@@ -52,7 +52,7 @@ async function fetchAndExecuteInjectScript(): Promise<void> {
52 const apiExposedResponse: unknown = await ipcRenderer.invoke( 52 const apiExposedResponse: unknown = await ipcRenderer.invoke(
53 ServiceToMainIpcMessage.ApiExposedInMainWorld, 53 ServiceToMainIpcMessage.ApiExposedInMainWorld,
54 ); 54 );
55 const injectSource = webSource.parse(apiExposedResponse); 55 const injectSource = WebSource.parse(apiExposedResponse);
56 // Isolated world 0 is the main world. 56 // Isolated world 0 is the main world.
57 await webFrame.executeJavaScriptInIsolatedWorld(0, [injectSource]); 57 await webFrame.executeJavaScriptInIsolatedWorld(0, [injectSource]);
58} 58}