fix initial document setup

This commit is contained in:
zadam
2019-02-20 23:07:57 +01:00
parent 60cbfdcabd
commit 3533160bef
6 changed files with 83 additions and 64 deletions

View File

@@ -13,9 +13,7 @@ const stream = require('stream');
const path = require('path');
const commonmark = require('commonmark');
const mimeTypes = require('mime-types');
let importNoteCount;
let lastSentCountTs = Date.now();
const ImportContext = require('../import_context');
/**
* @param {ImportContext} importContext
@@ -24,7 +22,8 @@ let lastSentCountTs = Date.now();
* @return {Promise<*>}
*/
async function importTar(importContext, fileBuffer, importRootNote) {
importNoteCount = 0;
importContext = importContext || new ImportContext("1", false);
// maps from original noteId (in tar file) to newly generated noteId
const noteIdMap = {};
const attributes = [];