mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-31 04:02:26 +08:00
fix(docs-edit): concurrency issue between import & export
This commit is contained in:
parent
09cb1eb5de
commit
eba4c1a545
@ -11,6 +11,7 @@ import { extractZip, initializeDatabase, startElectron } from "./electron-utils.
|
|||||||
import cls from "./src/services/cls.js";
|
import cls from "./src/services/cls.js";
|
||||||
import type { AdvancedExportOptions } from "./src/services/export/zip.js";
|
import type { AdvancedExportOptions } from "./src/services/export/zip.js";
|
||||||
import TaskContext from "./src/services/task_context.js";
|
import TaskContext from "./src/services/task_context.js";
|
||||||
|
import { deferred } from "./src/services/utils.js";
|
||||||
|
|
||||||
const NOTE_ID_USER_GUIDE = "pOsGYCXsbNQG";
|
const NOTE_ID_USER_GUIDE = "pOsGYCXsbNQG";
|
||||||
const NOTE_ID_RELEASE_NOTES = "hD3V4hiu2VW4";
|
const NOTE_ID_RELEASE_NOTES = "hD3V4hiu2VW4";
|
||||||
@ -22,12 +23,15 @@ async function main() {
|
|||||||
await initializeTranslations();
|
await initializeTranslations();
|
||||||
await initializeDatabase(true);
|
await initializeDatabase(true);
|
||||||
|
|
||||||
|
const initializedPromise = deferred<void>();
|
||||||
cls.init(async () => {
|
cls.init(async () => {
|
||||||
await importData(markdownPath);
|
await importData(markdownPath);
|
||||||
await importData(releaseNotesPath);
|
await importData(releaseNotesPath);
|
||||||
setOptions();
|
setOptions();
|
||||||
|
initializedPromise.resolve();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await initializedPromise;
|
||||||
await startElectron();
|
await startElectron();
|
||||||
|
|
||||||
// Wait for the import to be finished and the application to be loaded before we listen to changes.
|
// Wait for the import to be finished and the application to be loaded before we listen to changes.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user