mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix recursion in the inline image processing
This commit is contained in:
parent
ab4e83771c
commit
e0d4766c2d
@ -148,8 +148,16 @@ function saveImageToAttachment(noteId, uploadBuffer, originalName, shrinkImageSw
|
|||||||
title: fileName
|
title: fileName
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: this is a quick-fix solution of a recursive bug - this is called from asyncPostProcessContent()
|
||||||
|
// find some async way to do this - perhaps some global timeout with a Set of noteIds needing one more
|
||||||
|
// run of asyncPostProcessContent
|
||||||
|
setTimeout(() => {
|
||||||
|
sql.transactional(() => {
|
||||||
|
const note = becca.getNoteOrThrow(noteId);
|
||||||
const noteService = require("../services/notes");
|
const noteService = require("../services/notes");
|
||||||
noteService.asyncPostProcessContent(note, note.getContent()); // to mark an unused attachment for deletion
|
noteService.asyncPostProcessContent(note, note.getContent()); // to mark an unused attachment for deletion
|
||||||
|
});
|
||||||
|
}, 5000);
|
||||||
|
|
||||||
// resizing images asynchronously since JIMP does not support sync operation
|
// resizing images asynchronously since JIMP does not support sync operation
|
||||||
processImage(uploadBuffer, originalName, shrinkImageSwitch).then(({buffer, imageFormat}) => {
|
processImage(uploadBuffer, originalName, shrinkImageSwitch).then(({buffer, imageFormat}) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user