Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: remove SharedWorker requirement for multi tab sqlite driver

Abdullah Attadb8e21f83bb1
diff --git a/apps/web/src/common/db.ts b/apps/web/src/common/db.ts
index 20903d612..886eb0c94 100644
--- a/apps/web/src/common/db.ts
+++ b/apps/web/src/common/db.ts
@@ -56,7 +56,7 @@ async function initializeDatabase(persistence: DatabasePersistence) {
);
await storage.migrate();
- const multiTab = !!globalThis.SharedWorker && isFeatureSupported("opfs");
+ const multiTab = isFeatureSupported("opfs");
database.setup({
sqliteOptions: {
dialect: (name, init) =>
diff --git a/apps/web/src/components/error-boundary/index.tsx b/apps/web/src/components/error-boundary/index.tsx
index d482938a7..7eeabc446 100644
--- a/apps/web/src/components/error-boundary/index.tsx
+++ b/apps/web/src/components/error-boundary/index.tsx
@@ -247,7 +247,7 @@ function errorToString(error: unknown) {
}
async function resetDatabase() {
- const multiTab = !!globalThis.SharedWorker && isFeatureSupported("opfs");
+ const multiTab = isFeatureSupported("opfs");
await useKeyStore.getState().clear();
const dialect = createDialect({
name: "notesnook",
diff --git a/apps/web/src/utils/logger.ts b/apps/web/src/utils/logger.ts
index 90d679e76..98a242883 100644
--- a/apps/web/src/utils/logger.ts
+++ b/apps/web/src/utils/logger.ts
@@ -27,7 +27,7 @@ import { isFeatureSupported } from "./feature-check";
let logger: typeof _logger = new NoopLogger();
async function initializeLogger() {
- const multiTab = !!globalThis.SharedWorker && isFeatureSupported("opfs");
+ const multiTab = isFeatureSupported("opfs");
await initialize(
{
dialect: (name, init) =>