Skip to content

Commit

Permalink
feat: disable web worker if firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
ledouxm committed Dec 10, 2024
1 parent 522ed56 commit 1ff6a1b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/frontend/src/components/CompatibilityAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const browser = Bowser.getParser(window.navigator.userAgent);
const isWrongVersion = browser.getBrowser().name === "Firefox" && browser.getBrowserVersion().startsWith("102");

export const CompatibilityAlert = () => {
if (!isWrongVersion) return null;
// if (!isWrongVersion) return null;
return null;
return (
<Center>
<Alert
Expand Down
7 changes: 7 additions & 0 deletions packages/frontend/src/db/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@ import { AppSchema, Database } from "./AppSchema";
import { Connector } from "./Connector";
import { wrapPowerSyncWithKysely } from "@powersync/kysely-driver";
import { useQuery } from "@powersync/react";
import Bowser from "bowser";

const browser = Bowser.getParser(window.navigator.userAgent);
const isFirefox = browser.getBrowser().name === "Firefox";

export const powerSyncDb = new PowerSyncDatabase({
schema: AppSchema,
flags: {
useWebWorker: !isFirefox,
},
database: {
dbFilename: "crvif-sync.db",
},
Expand Down

0 comments on commit 1ff6a1b

Please sign in to comment.