changed import progress notification so it shows up for drag & drop as well

This commit is contained in:
zadam
2019-10-14 10:31:58 +02:00
parent 2fb3a3eff9
commit 2ee94a3a69
14 changed files with 136 additions and 134 deletions

View File

@@ -13,7 +13,7 @@ const ImportContext = require('../../services/import_context');
async function importToBranch(req) {
const {parentNoteId} = req.params;
const {importId} = req.body;
const {importId, last} = req.body;
const options = {
safeImport: req.body.safeImport !== 'false',
@@ -65,6 +65,11 @@ async function importToBranch(req) {
return [500, message];
}
if (last === "true") {
// small timeout to avoid race condition (message is received before the transaction is committed)
setTimeout(() => importContext.importSucceeded(parentNoteId, note.noteId), 1000);
}
// import has deactivated note events so note cache is not updated
// instead we force it to reload (can be async)
noteCacheService.load();