fallback for missing parsed title, closes trilium-web-clipper/issues/16

This commit is contained in:
zadam 2020-07-11 23:05:28 +02:00
parent 1b0a2b41da
commit 3219441fdf

View File

@ -65,7 +65,11 @@ async function addClipping(req) {
}
async function createNote(req) {
const {title, content, pageUrl, images, clipType} = req.body;
let {title, content, pageUrl, images, clipType} = req.body;
if (!title || !title.trim()) {
title = "Clipped note from " + pageUrl;
}
log.info(`Creating clipped note from ${pageUrl}`);
@ -155,4 +159,4 @@ module.exports = {
addClipping,
openNote,
handshake
};
};