Skip to content

Commit

Permalink
add communicate with electron via IPC
Browse files Browse the repository at this point in the history
  • Loading branch information
invisal committed Nov 13, 2024
1 parent 128711e commit eaf919e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/drivers/iframe-driver.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use client";
import { DatabaseResultSet } from "./base-driver";
import MySQLLikeDriver from "./mysql/mysql-driver";
import { SqliteLikeBaseDriver } from "./sqlite-base-driver";
Expand Down Expand Up @@ -117,9 +118,10 @@ export class IframeSQLiteDriver extends SqliteLikeBaseDriver {
}

export class IframeMySQLDriver extends MySQLLikeDriver {
protected conn = window.outerbaseIpc
? new ElectronConnection()
: new IframeConnection();
protected conn =
typeof window !== "undefined" && window?.outerbaseIpc
? new ElectronConnection()
: new IframeConnection();

listen() {
this.conn.listen();
Expand Down

0 comments on commit eaf919e

Please sign in to comment.