mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 22:49:45 +01:00
fix: bypass first signup screen for tests
This commit is contained in:
@@ -9,38 +9,35 @@ import { getCurrentHash, hashNavigate } from "../navigation";
|
|||||||
* @type {import("notes-core/api").default}
|
* @type {import("notes-core/api").default}
|
||||||
*/
|
*/
|
||||||
var db;
|
var db;
|
||||||
function initializeDatabase() {
|
async function initializeDatabase() {
|
||||||
return import("notes-core/api").then(async ({ default: Database }) => {
|
const { default: Database } = await import("notes-core/api");
|
||||||
db = new Database(StorageInterface, EventSource);
|
db = new Database(StorageInterface, EventSource);
|
||||||
// db.host({
|
// db.host({
|
||||||
// API_HOST: "https://api.notesnook.com",
|
// API_HOST: "https://api.notesnook.com",
|
||||||
// AUTH_HOST: "https://auth.streetwriters.co",
|
// AUTH_HOST: "https://auth.streetwriters.co",
|
||||||
// SSE_HOST: "https://events.streetwriters.co",
|
// SSE_HOST: "https://events.streetwriters.co",
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// db.host({
|
// db.host({
|
||||||
// API_HOST: "http://localhost:5264",
|
// API_HOST: "http://localhost:5264",
|
||||||
// AUTH_HOST: "http://localhost:8264",
|
// AUTH_HOST: "http://localhost:8264",
|
||||||
// SSE_HOST: "http://localhost:7264",
|
// SSE_HOST: "http://localhost:7264",
|
||||||
// });
|
// });
|
||||||
|
|
||||||
db.host({
|
db.host({
|
||||||
API_HOST: "http://192.168.10.23:5264",
|
API_HOST: "http://192.168.10.23:5264",
|
||||||
AUTH_HOST: "http://192.168.10.23:8264",
|
AUTH_HOST: "http://192.168.10.23:8264",
|
||||||
SSE_HOST: "http://192.168.10.23:7264",
|
SSE_HOST: "http://192.168.10.23:7264",
|
||||||
});
|
|
||||||
|
|
||||||
await db.init();
|
|
||||||
|
|
||||||
if (!isAppHydrated()) {
|
|
||||||
if (process.env.REACT_APP_CI) return;
|
|
||||||
try {
|
|
||||||
loadDefaultNotes(db);
|
|
||||||
} catch (e) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
return db;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await db.init();
|
||||||
|
|
||||||
|
if (!isAppHydrated() && !process.env.REACT_APP_CI) {
|
||||||
|
try {
|
||||||
|
loadDefaultNotes(db);
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
return db;
|
||||||
}
|
}
|
||||||
|
|
||||||
export { db, initializeDatabase };
|
export { db, initializeDatabase };
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ if (process.env.NODE_ENV === "production") {
|
|||||||
initializeDatabase().then(async (db) => {
|
initializeDatabase().then(async (db) => {
|
||||||
const isLoggedIn = !!(await db.user.getUser());
|
const isLoggedIn = !!(await db.user.getUser());
|
||||||
if (
|
if (
|
||||||
|
!process.env.REACT_APP_CI &&
|
||||||
!isLoggedIn &&
|
!isLoggedIn &&
|
||||||
window.location.pathname === "/" &&
|
window.location.pathname === "/" &&
|
||||||
!Config.get("skipInitiation", false)
|
!Config.get("skipInitiation", false)
|
||||||
|
|||||||
@@ -1926,6 +1926,7 @@
|
|||||||
"@notesnook/desktop@./desktop/":
|
"@notesnook/desktop@./desktop/":
|
||||||
version "1.4.1"
|
version "1.4.1"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
electron-data-storage "^1.0.7"
|
||||||
electron-serve "^1.1.0"
|
electron-serve "^1.1.0"
|
||||||
electron-updater "^4.3.8"
|
electron-updater "^4.3.8"
|
||||||
node-fetch "^2.6.1"
|
node-fetch "^2.6.1"
|
||||||
@@ -5088,6 +5089,11 @@ ejs@^3.1.5:
|
|||||||
dependencies:
|
dependencies:
|
||||||
jake "^10.6.1"
|
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:
|
electron-serve@^1.1.0:
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/electron-serve/-/electron-serve-1.1.0.tgz#507f56c8512c501880d3a9bec792fa92512af378"
|
resolved "https://registry.yarnpkg.com/electron-serve/-/electron-serve-1.1.0.tgz#507f56c8512c501880d3a9bec792fa92512af378"
|
||||||
|
|||||||
Reference in New Issue
Block a user