fix new window loading bug

This commit is contained in:
nicwands
2026-05-08 13:18:16 -04:00
parent 75d3488de0
commit a43c3221da
5 changed files with 41 additions and 32 deletions

View File

@@ -438,6 +438,7 @@ const initializeCore = async (runtime, { plugins }) => {
let notesAPI = null;
let initPromise = null;
const getNotesAPI = async () => {
console.log("getNotesAPI before: ", notesAPI);
if (notesAPI) return notesAPI;
if (!initPromise) {
initPromise = (async () => {
@@ -458,6 +459,7 @@ const initializeCore = async (runtime, { plugins }) => {
);
notesAPI = new NotesAPI(adapter, encryptionKey);
await notesAPI.init();
console.log("getNotesAPI after: ", notesAPI);
return notesAPI;
})();
}