From d66d77083fa25a15cd346750e0c7e2f6b544bab7 Mon Sep 17 00:00:00 2001 From: fydne <121295212+fydne@users.noreply.github.com> Date: Sun, 26 Feb 2023 04:34:01 +0500 Subject: [PATCH] add isInitialized --- src/main/index.ts | 2 +- src/main/server.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/index.ts b/src/main/index.ts index d06177a..c4bc390 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -1 +1 @@ -export { initialize, enable } from "./server"; +export { initialize, isInitialized, enable } from "./server"; diff --git a/src/main/server.ts b/src/main/server.ts index 0c988ed..8d2e0e4 100644 --- a/src/main/server.ts +++ b/src/main/server.ts @@ -357,7 +357,12 @@ const logStack = function (contents: WebContents, code: string, stack: string | } } -let initialized = false +let initialized = false; + +export function isInitialized() { + return initialized; +} + export function initialize() { if (initialized) throw new Error('@electron/remote has already been initialized')