Skip to content

Commit

Permalink
check worker uri rather than worker boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
tantaman committed Apr 20, 2023
1 parent 464e5e2 commit 7a5d5c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/packages/client-websocket/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default async function startSyncWith(
args: Overwrite<
ReplicatorArgs,
{ remoteDbId: Uint8Array | string; rx: TblRx }
> & { worker?: boolean; workerUri?: string }
> & { workerUri?: string }
): Promise<{ stop: () => void }> {
const parsedArgs = {
...args,
Expand All @@ -27,7 +27,7 @@ export default async function startSyncWith(
};

// worker must explicitly be false to disable
if (args.worker !== false) {
if (args.workerUri) {
if (args.localDb.filename === ":memory:") {
throw new Error(
"In-memory databases cannot be accessed from a web-worker and must be synced in the main thread. Set worker: false in the replicator args"
Expand Down

0 comments on commit 7a5d5c0

Please sign in to comment.