mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix
This commit is contained in:
parent
007e45ad8c
commit
16c3833a36
@ -13,7 +13,6 @@ const utils = require('./services/utils');
|
||||
const assetPath = require('./services/asset_path');
|
||||
require('./services/handlers');
|
||||
require('./becca/becca_loader');
|
||||
require('./services/help_import');
|
||||
|
||||
const app = express();
|
||||
|
||||
|
@ -17,14 +17,12 @@ const sql = require('./sql');
|
||||
|
||||
const HELP_FILE_PATH = '/home/adam/Downloads/Help4.zip';
|
||||
|
||||
beccaLoader.beccaLoaded.then(() => {
|
||||
cls.init(async () => {
|
||||
const hiddenRoot = becca.getNote("_hidden");
|
||||
const data = await fs.readFile(HELP_FILE_PATH, "binary");
|
||||
async function importHelp() {
|
||||
const hiddenRoot = becca.getNote("_hidden");
|
||||
const data = await fs.readFile(HELP_FILE_PATH, "binary");
|
||||
|
||||
await importZip(Buffer.from(data, 'binary'), hiddenRoot);
|
||||
});
|
||||
});
|
||||
await importZip(Buffer.from(data, 'binary'), hiddenRoot);
|
||||
}
|
||||
|
||||
async function importZip(fileBuffer, importRootNote) {
|
||||
// maps from original noteId (in ZIP file) to newly generated noteId
|
||||
@ -477,3 +475,7 @@ function readZipFile(buffer, processEntryCallback) {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
importHelp
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ const sql = require("./sql");
|
||||
const becca = require("../becca/becca");
|
||||
const protectedSessionService = require("../services/protected_session");
|
||||
const hiddenSubtreeService = require("./hidden_subtree");
|
||||
const helpImportService = require("./help_import");
|
||||
|
||||
function getRunAtHours(note) {
|
||||
try {
|
||||
@ -51,7 +52,11 @@ function runNotesWithLabel(runAttrValue) {
|
||||
}
|
||||
|
||||
sqlInit.dbReady.then(() => {
|
||||
cls.init(() => hiddenSubtreeService.checkHiddenSubtree());
|
||||
cls.init(() => {
|
||||
hiddenSubtreeService.checkHiddenSubtree();
|
||||
|
||||
helpImportService.importHelp();
|
||||
});
|
||||
|
||||
if (!process.env.TRILIUM_SAFE_MODE) {
|
||||
setTimeout(cls.wrap(() => runNotesWithLabel('backendStartup')), 10 * 1000);
|
||||
|
Loading…
x
Reference in New Issue
Block a user