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 <[email protected]>
  • Loading branch information
fydne and erickzhao authored 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
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { initialize, enable } from "./server";
export { initialize, isInitialized, enable } from "./server";
5 changes: 5 additions & 0 deletions src/main/server.ts
Original file line number Diff line number Diff line change
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.