Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
WORKAROUND: Only use a single powersync instance.
Browse files Browse the repository at this point in the history
  • Loading branch information
cahofmeyr committed Jan 15, 2024
1 parent 164c9c7 commit 60b761b
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ import { CircularProgress } from '@mui/material';
const SupabaseContext = React.createContext<SupabaseConnector | null>(null);
export const useSupabase = () => React.useContext(SupabaseContext);

const powersync = new WASQLitePowerSyncDatabaseOpenFactory({
dbFilename: 'powersync2.db',
schema: AppSchema,
flags: {
disableSSRWarning: true
}
}).getInstance();

export const SystemProvider = ({ children }: { children: React.ReactNode }) => {
const [connector] = React.useState(new SupabaseConnector());
const [powerSync] = React.useState(
new WASQLitePowerSyncDatabaseOpenFactory({
dbFilename: 'powersync2.db',
schema: AppSchema,
flags: {
disableSSRWarning: true
}
}).getInstance()
);
const [powerSync] = React.useState(powersync);

const router = useRouter();

Expand Down

0 comments on commit 60b761b

Please sign in to comment.