Skip to content

Commit

Permalink
feat: add isInitialized (#150)
Browse files Browse the repository at this point in the history
* add isInitialized

* Update src/main/server.ts

---------

Co-authored-by: Erick Zhao <erick@hotmail.ca>
  • Loading branch information
fydne and erickzhao committed Nov 7, 2023
1 parent 4e83331 commit c258862
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/index.ts
@@ -1 +1 @@
export { initialize, enable } from "./server";
export { initialize, isInitialized, enable } from "./server";
5 changes: 5 additions & 0 deletions src/main/server.ts
Expand Up @@ -358,6 +358,11 @@ const logStack = function (contents: WebContents, code: string, stack: string |
}

let initialized = false

export function isInitialized() {
return initialized
}

export function initialize() {
if (initialized)
throw new Error('@electron/remote has already been initialized')
Expand Down

0 comments on commit c258862

Please sign in to comment.