Skip to content

Commit b3f4f13

Browse files
authored
🐛 fix: try to fix pglite worker (#6169)
* try to fix pglite worker * Update db.ts
1 parent c5d372f commit b3f4f13

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/database/client/db.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ export class DatabaseManager {
201201
const dbName = 'lobechat';
202202

203203
// make db as web worker if worker is available
204-
if (typeof Worker !== 'undefined') {
204+
// https://github.com/lobehub/lobe-chat/issues/5785
205+
if (typeof Worker !== 'undefined' && typeof navigator.locks !== 'undefined') {
205206
db = await initPgliteWorker({
206207
dbName,
207208
fsBundle: fsBundle as Blob,

0 commit comments

Comments
 (0)