mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
perf: do not wait for default notes to load
This commit is contained in:
@@ -2,6 +2,7 @@ import StorageInterface from "../interfaces/storage";
|
|||||||
import EventSource from "eventsource";
|
import EventSource from "eventsource";
|
||||||
import Config from "../utils/config";
|
import Config from "../utils/config";
|
||||||
import http from "notes-core/utils/http";
|
import http from "notes-core/utils/http";
|
||||||
|
import { EV, EVENTS } from "notes-core/common";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {import("notes-core/api").default}
|
* @type {import("notes-core/api").default}
|
||||||
@@ -26,8 +27,7 @@ function initializeDatabase() {
|
|||||||
|
|
||||||
if (!isAppHydrated()) {
|
if (!isAppHydrated()) {
|
||||||
try {
|
try {
|
||||||
await loadDefaultNotes(db);
|
loadDefaultNotes(db);
|
||||||
setAppHydrated();
|
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -58,7 +58,9 @@ async function loadDefaultNotes(db) {
|
|||||||
if (note.autoOpen) autoOpenId = id;
|
if (note.autoOpen) autoOpenId = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EV.publish(EVENTS.appRefreshRequested);
|
||||||
if (autoOpenId) quickNavigate(`/notes/${autoOpenId}/edit`);
|
if (autoOpenId) quickNavigate(`/notes/${autoOpenId}/edit`);
|
||||||
|
setAppHydrated();
|
||||||
}
|
}
|
||||||
|
|
||||||
function quickNavigate(url) {
|
function quickNavigate(url) {
|
||||||
|
|||||||
Reference in New Issue
Block a user