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 1/2] 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') From e60d28de81b3e15a759a387d639bc5106d6d2f36 Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Tue, 7 Nov 2023 14:10:58 -0800 Subject: [PATCH 2/2] Update src/main/server.ts --- src/main/server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/server.ts b/src/main/server.ts index 8d2e0e4..811be07 100644 --- a/src/main/server.ts +++ b/src/main/server.ts @@ -357,10 +357,10 @@ const logStack = function (contents: WebContents, code: string, stack: string | } } -let initialized = false; +let initialized = false export function isInitialized() { - return initialized; + return initialized } export function initialize() {