Skip to content

Commit

Permalink
Allow to specify bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
Y-- authored and Mytherin committed Jan 9, 2024
1 parent bcaecee commit 1fa34e3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/react-duckdb/src/platform_provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ export const DuckDBPlatform: React.FC<PlatformProps> = (props: PlatformProps) =>
if (inFlight.current) return await inFlight.current;
inFlight.current = (async () => {
try {
const params = new URLSearchParams(window.location.search);
const bundleName = params.get('bundle') as keyof duckdb.DuckDBBundles | null;
setBundle(b => b.updateRunning());
const next = await duckdb.selectBundle(props.bundles);

const bundle = bundleName !== null ? props.bundles[bundleName] : null;
const next = (bundle || (await duckdb.selectBundle(props.bundles))) as duckdb.DuckDBBundle;
inFlight.current = null;
setBundle(b => b.completeWith(next));
return next;
Expand Down

0 comments on commit 1fa34e3

Please sign in to comment.