A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
fix: bypass first signup screen for tests
thecodrr1f2c6e623dcc
diff --git a/apps/web/src/common/db.js b/apps/web/src/common/db.jsindex 303ae530a..eb5d71e98 100644--- a/apps/web/src/common/db.js+++ b/apps/web/src/common/db.js@@ -9,38 +9,35 @@ import { getCurrentHash, hashNavigate } from "../navigation";* @type {import("notes-core/api").default}*/var db;-function initializeDatabase() {- return import("notes-core/api").then(async ({ default: Database }) => {- db = new Database(StorageInterface, EventSource);- // db.host({- // API_HOST: "https://api.notesnook.com",- // AUTH_HOST: "https://auth.streetwriters.co",- // SSE_HOST: "https://events.streetwriters.co",- // });+async function initializeDatabase() {+ const { default: Database } = await import("notes-core/api");+ db = new Database(StorageInterface, EventSource);+ // db.host({+ // API_HOST: "https://api.notesnook.com",+ // AUTH_HOST: "https://auth.streetwriters.co",+ // SSE_HOST: "https://events.streetwriters.co",+ // });- // db.host({- // API_HOST: "http://localhost:5264",- // AUTH_HOST: "http://localhost:8264",- // SSE_HOST: "http://localhost:7264",- // });+ // db.host({+ // API_HOST: "http://localhost:5264",+ // AUTH_HOST: "http://localhost:8264",+ // SSE_HOST: "http://localhost:7264",+ // });- db.host({- API_HOST: "http://192.168.10.23:5264",- AUTH_HOST: "http://192.168.10.23:8264",- SSE_HOST: "http://192.168.10.23:7264",- });-- await db.init();+ db.host({+ API_HOST: "http://192.168.10.23:5264",+ AUTH_HOST: "http://192.168.10.23:8264",+ SSE_HOST: "http://192.168.10.23:7264",+ });- if (!isAppHydrated()) {- if (process.env.REACT_APP_CI) return;- try {- loadDefaultNotes(db);- } catch (e) {}- }+ await db.init();- return db;- });+ if (!isAppHydrated() && !process.env.REACT_APP_CI) {+ try {+ loadDefaultNotes(db);+ } catch (e) {}+ }+ return db;}export { db, initializeDatabase };diff --git a/apps/web/src/index.js b/apps/web/src/index.jsindex 1b7618be8..ae1021a0e 100644--- a/apps/web/src/index.js+++ b/apps/web/src/index.js@@ -15,6 +15,7 @@ if (process.env.NODE_ENV === "production") {initializeDatabase().then(async (db) => {const isLoggedIn = !!(await db.user.getUser());if (+ !process.env.REACT_APP_CI &&!isLoggedIn &&window.location.pathname === "/" &&!Config.get("skipInitiation", false)diff --git a/apps/web/yarn.lock b/apps/web/yarn.lockindex 3a6c395fa..d2dc6cdde 100644--- a/apps/web/yarn.lock+++ b/apps/web/yarn.lock@@ -1926,6 +1926,7 @@"@notesnook/desktop@./desktop/":version "1.4.1"dependencies:+ electron-data-storage "^1.0.7"electron-serve "^1.1.0"electron-updater "^4.3.8"node-fetch "^2.6.1"@@ -5088,6 +5089,11 @@ ejs@^3.1.5:dependencies:jake "^10.6.1"+electron-data-storage@^1.0.7:+ version "1.0.7"+ resolved "https://registry.yarnpkg.com/electron-data-storage/-/electron-data-storage-1.0.7.tgz#983322d44f9af0bb6f5c9cb66eccc291e14ff486"+ integrity sha512-dTT1l2DlEk2DqUVgOpaftJLMjRt0AkOGHR9tA2VUUFfs6ORRL+O0JJR93zjQngZCA9U9g/N0VBbsINdZDiVQGg==+electron-serve@^1.1.0:version "1.1.0"resolved "https://registry.yarnpkg.com/electron-serve/-/electron-serve-1.1.0.tgz#507f56c8512c501880d3a9bec792fa92512af378"