File tree Expand file tree Collapse file tree 3 files changed +23
-8
lines changed
demos/react-supabase-todolist/src
packages/web/src/db/adapters/wa-sqlite Expand file tree Collapse file tree 3 files changed +23
-8
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,10 @@ root.render(<App />);
99
1010export function App ( ) {
1111 return (
12- < >
13- < meta name = "viewport" content = "width=device-width, initial-scale=1.0" > </ meta >
14- < ThemeProviderContainer >
15- < SystemProvider >
16- < RouterProvider router = { router } />
17- </ SystemProvider >
18- </ ThemeProviderContainer >
19- </ >
12+ < ThemeProviderContainer >
13+ < SystemProvider >
14+ < RouterProvider router = { router } />
15+ </ SystemProvider >
16+ </ ThemeProviderContainer >
2017 ) ;
2118}
Original file line number Diff line number Diff line change 11< html lang ="en ">
22 < head >
33 < meta name ="theme-color " content ="#c44eff " />
4+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
45 < link rel ="apple-touch-icon " href ="/icons/icon.png " />
56 < link rel ="stylesheet " href ="./app/globals.css " />
67 < script type ="module " src ="./app/index.tsx "> </ script >
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ export interface ResolvedWASQLiteOpenFactoryOptions extends ResolvedWebSQLOpenOp
2121export class WASQLiteOpenFactory extends AbstractWebSQLOpenFactory {
2222 constructor ( options : WASQLiteOpenFactoryOptions ) {
2323 super ( options ) ;
24+
25+ assertValidWASQLiteOpenFactoryOptions ( options ) ;
2426 }
2527
2628 get waOptions ( ) : WASQLiteOpenFactoryOptions {
@@ -84,3 +86,18 @@ export class WASQLiteOpenFactory extends AbstractWebSQLOpenFactory {
8486 }
8587 }
8688}
89+
90+ /**
91+ * Asserts that the factory options are valid.
92+ */
93+ function assertValidWASQLiteOpenFactoryOptions ( options : WASQLiteOpenFactoryOptions ) : void {
94+ // The OPFS VFS only works in dedicated web workers.
95+ if ( 'vfs' in options && 'flags' in options ) {
96+ const { vfs, flags = { } } = options ;
97+ if ( vfs !== WASQLiteVFS . IDBBatchAtomicVFS && 'useWebWorker' in flags && ! flags . useWebWorker ) {
98+ throw new Error (
99+ `Invalid configuration: The 'useWebWorker' flag must be true when using an OPFS-based VFS (${ vfs } ).`
100+ ) ;
101+ }
102+ }
103+ }
You can’t perform that action at this time.
0 commit comments